VoiceRecorder elements let you collect audio samples after requesting access to a recording device.
Creation:
newVoiceRecorder("recorder")
If print
is called, this will add two <buttons>
to the page: the button to the left starts/stops recording and the button to the right starts/stops playback.
In order to collect voice recordings, you need to
- upload a PHP file on a server where you can store an archive of the audio recording files. See the page How to collect audio recordings on a server for instructions.
- initiate the recorder before creating a voiceRecorder element, by adding to the items variable a PennController instance that will call InitiateRecorder with the URL of your PHP file, e.g.
[js try=”data”]InitiateRecorder(“http://myserver/saveVoiceRecordings.php”);
newTrial(
newVoiceRecorder(“recorder”)
.print()
,
newButton(“send”, “Click here to send your recording.”)
.print()
.wait()
);[/js]
Commands
[yadawiki-list category=”NonTest command,VoiceRecorder element”]
Tests
[yadawiki-list category=”Test command,VoiceRecorder element”]
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