This page describes the configuration you need to set up to record and collect audio and/or video samples with your project. Once you have set up your configuration, use the MediaRecorder element to let your participants record audio samples.
Server setup
Please note that neither the PCIbex Farm nor the original Ibex Farm provide hosting for collected samples. You need to have access to a server where you can upload and execute a PHP file, and which will authorize the PHP file to upload ZIP files to a subfolder. Free web hosting services such as Dropbox or Google drive typically do NOT offer that option. Web hosting solutions that you access via FTP/SSH (e.g., Dreamhost) would typically do the job.
- On your server, create a new folder dedicated to audio recording collection
- In that folder, create a subfolder named uploads (all lower-case, note the s at the end)
- Make sure the owner has permission to write the uploads subfolder: the first digit of the numeric permissions value should be 6 or 7; if you are using a terminal, try executing chmod -R 755 uploads from the main folder. The owner should correspond to the webserver user; with most configurations, that user is named www-data: if you are using a terminal, try executing chown -R www-data uploads/ from the main folder
- In the main folder (i.e., NOT in uploads) upload a PHP file containing the following code:
[php highlight=”5,6″]
[/php]
For maximal security, remove the PHP file from your server as soon as your are done collecting recordings.
Project setup
You need to tell your experiment where to upload the recordings before any MediaRecorder command gets evaluated. To this end, you should create a trial using the command InitiateRecorder. Make sure that the trial is run before any trial using a MediaRecorder element (use the .label command if needed). This is pretty simple in practice:
[js try=”data”]// Indicate where to look for the PHP file you uploaded on you server
Sequence(“consent”,”experiment”)
InitiateRecorder(“https://my.server/myExperiment/myFile.php”).label(“consent”);
newTrial( “experiment” ,
newText(“instructions”, “Please record a sample and proceed.”)
.print()
,
newMediaRecorder(“recorder”)
.print()
,
newButton(“continue”, “Click here to continue”)
.print()
.wait()
);
[/js]
Index
- Tutorial
- Commands by element categories
- Standard Element Commands
- Audio element
- Button element
- Canvas element
- DropDown element
- EyeTracker element
- Function element
- Html element
- Image element
- Key element
- MediaRecorder element
- Scale element
- Selector element
- Text element
- TextInput element
- Timer element
- Tooltip element
- Var element
- Video element
- Youtube element
- Special clear command
- Special end command
- Global PennController Commands
- PennController
- PennController.AddHost
- PennController.AddTable
- PennController.CheckPreloaded
- PennController.Debug
- PennController.DownloadVoiceButton
- PennController.FeedItems
- PennController.Footer
- PennController.GetTable
- PennController.GetURLParameter
- PennController.Header
- PennController.InitiateRecorder
- PennController.PreloadZip
- PennController.ResetPrefix
- PennController.SendResults
- PennController.Sequence
- PennController.SetCounter
- PennController.Template
- Installing PennController
- Ontology
- Aesthetics
- Preloading resources
- ZIPped resources
- Spreadsheet (CSV)
- Canvas creation
- Setup for audio recordings collection