VoiceRecorder element

The VoiceRecorder element is deprecated since PennController 1.8. See the MediaRecorder element instead.
Recording audio requires hosting your experiment on a secure domain. As of April 26, 2020, both the original Ibex Farm and the PCIbex Farm have secure domains (https): you can set up recording collection using either platform.

The recordings you collect will be uploaded as .mp3 files inside a .zip archive file for each participant. However due to a problem with how the voiceRecorder element was coded, the files actually are .ogg files. If you are unable to open them, try using VLC media player.

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

  1. 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.
  2. 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”]