voicerecorder.stop

The VoiceRecorder element is deprecated since PennController 1.8. See mediarecorder.stop instead.

getVoiceRecorder(id).stop()

Stop recording audio / playing last recording.

Example:

[js highlight=”12,20″ try=”data”]InitiateRecorder(“https://myserver/upload.php”);

newTrial(
newVoiceRecorder(“recorder”)
.record()
,
newTimer(“recording”, 3000)
.start()
.wait()
,
getVoiceRecorder(“recorder”)
.stop()
.play()
,
newTimer(“preview”, 1000)
.start()
.wait()
,
getVoiceRecorder(“recorder”)
.stop()
);[/js]

Will start recording audio and stop recording after 2s, then play back the first second of the recording and stop the playback.