Speech Block
The speech
block provides the ability to present the participant with an audio recording response. A speech
block has to be specified within a response
block. The structure of this block is summarised below.
Informing the participant
The first time audio recording starts for your experiment, the user will unavoidably be asked to grant audio recording permissions to the ROLEG website. If the participant denies this request, an error message will be displayed and the participant will be asked to refresh the page to restart the experiment in order to grant the required recording permissions. Only after the participant grants permission, the trial starts. Therefore, it is important to properly inform your participant prior to presenting a speech
block. It is recommended to first include a text
stimulus block to explain the recording procedure and the upcoming permission request, followed by a test speech
response that allows a user to practice recording audio with enabled playback controls in order to verify their microphone works correctly.
Warning
A trial with speech recording will only start once recording permission has been obtained.
The start time of the trial indicates when permission was successfully obtained (if not already done so earlier in the experiment).
Furthermore, the participant will be shown a grey, outlined microphone indicator prior to audio recording and a red, filled microphone indicator when audio recording is in progress. This indicator cannot be disabled. If relevant, make sure to inform your participant that this indicator is not part of the stimulus.
Warning
Recording audio also requires the participant to have a functioning microphone, and a browser that supports recording audio, such as most major browsers (Google Chrome, Firefox, Safari, Microsoft Edge). If these conditions are not met, the participant will be presented with an error message and asked, in a localised message, to verify their microphone is working or to attempt the experiment on another browser and start the experiment again. In these cases, the experiment will not continue. It is therefore strongly recommended to include a practice recording trial early on in your experiment, to avoid asking the participant to redo prior trials and obtaining duplicate results.
Note
The audio quality of the recording is dependent on the microphone of the participant. To avoid background noise, a microphone close to the speaker is recommended. ROLEG acquires and stores audio recordings in .wav
format and does not apply compression.
Parameters
- max_duration
-
Required.
Integer that specifies the duration of the recording in milliseconds.Audio recordings may be a little shorter than
max_duration
, as it can take a little time for recording to start. To compensate for this, you can add a small amount of 200 tomax_duration
. - recording_delay
- Optional, defaults to 0.
Integer that specifies the number of milliseconds of delay introduced before the recording starts. - max_number_recordings
- Optional, defaults to 1.
Integer or KeywordINFINITY
that specifies how many times speech can be recorded. If this parameter has a value of greater than one, after recording, playback controls and a re-record button will be presented to the participant until the recording limit is met. - require_waiting
- Boolean, defaults to
true
.
Boolean that specifies whether the user should wait for themax_duration
of the speech recording or if they can continue the trial in the meantime, by for example using abutton
response.
Example usage
The code below illustrates how the speech
block might be used.
experiment {
trial {
stimulus {
text = "Please check if your microphone is working correctly \
and if you can hear yourself." //(1)
}
response {
speech {
max_duration = 5000
max_number_recordings = 3
}
button
}
}
}
- Confused? See Preliminaries for a refresher on how linebreaks work.