Skip to content

Tokenized Audio Stimulus

A tokenized-audio stimulus is similar to the tokenized text stimulus, except that here a token is an audio clip instead of a text segment. A tokenized-audio stimulus can be particularly useful for creating a self-paced listening study. When the participant presses the designated key for advancing in the stimulus, the currently playing audio clip will be cut off, and the next audio clip (if it exists) will start playing.

Required Properties

type

  • Definition: The type of stimulus (text, tokenized_text, image, etc.)
  • Possible values: For a tokenized-audio stimulus, type must be specified as tokenized_audio.
1
2
3
4
{
  "type": "tokenized_audio",
  "content": ["a.mp3", "b.mp3", "c.mp3"]
}

content

  • Definition: A list consisting of the file names of the list of audio clips to be played
  • Possible values: Must be the file names of the audio files (e.g. ["a.mp3", "b.mp3", "c.mp3"])
  • Format support is dependent on the participant's browser. See Tips tab for further information.
1
2
3
4
{
  "type": "tokenized_audio",
  "content": ["a.mp3", "b.mp3", "c.mp3"]
}
  • mp3 tends to work well across our supported browsers and all major operating systems (Windows, Mac, and Linux). However, there is a chance that older Linux systems with older browsers will not support this format.
  • There are many ways to convert your audio stimuli to the desired format. For audio transcoding, check out fre:ac.

Optional Properties

barrier

  • Definition: If set to true, then all subsequent stimuli and responses will not be displayed until this tokenized audio stimulus displays all its audio clips.
  • Possible values: true or false
  • Default: true
  • See also: delay

1
2
3
4
5
{
  "type": "tokenized_audio",
  "content": ["a.mp3", "b.mp3", "c.mp3"],
  "barrier": false
}
In trials using the above stimulus code, other stimuli and responses will be displayed at the same time as the tokenized audio.
1
2
3
4
5
{
  "type": "tokenized_audio",
  "content": ["a.mp3", "b.mp3", "c.mp3"],
  "barrier": true
}
In trials using the above stimulus code, the tokenized audio will play before other stimuli and responses are displayed. This code is equivalent to code where the barrier property is not specified.

delay

1
2
3
4
5
{
  "type": "tokenized_audio",
  "content": ["a.mp3", "b.mp3", "c.mp3"],
  "delay": 1.6
}
The above code introduces a delay of 1600 milliseconds.

hint

  • Definition: Whether to display an instruction note that tells participants to press the key_advance key to play the next audio clip.
  • Possible values: true or false
  • Default: true
  • Instruction reads Press the "[key]" key to play the sounds. where [key] is the key specified in key_advance.
  • Setting this to false can be useful if participants are given sufficient practice in prior parts of the study.
1
2
3
4
5
{
  "type": "tokenized_audio",
  "content": ["a.mp3", "b.mp3", "c.mp3"],
  "hint": false
}

key_advance

  • Definition: The key that a participant should press to play each audio clip in the content list when self_paced is true.
  • Possible values: Any alphanumeric character, and one of the following keys: "ArrowUp", "ArrowDown", "ArrowLeft", "ArrowRight", "ShiftLeft", "ShiftRight", "ControlLeft", "ControlRight", "AltLeft", "AltRight"
  • Default: " " (i.e., the space bar)
1
2
3
4
5
{
  "type": "tokenized_audio",
  "content": ["a.mp3", "b.mp3", "c.mp3"],
  "key_advance": "j"
}

last_token_skippable

  • Definition: Whether or not participants can press the key_advance key to skip the very last audio clip in the list
  • Possible values: true or false
  • Default: false
  • Setting this to true will potentially allow participants to speed through the entire stimulus without listening to anything (i.e., holding down the designated key throughout the process).
1
2
3
4
5
{
  "type": "tokenized_audio",
  "content": ["a.mp3", "b.mp3", "c.mp3"],
  "last_token_skippable": true
}

parent

  • Definition: If specified, then the properties of the specified stimulus will be inherited by this stimulus, unless a property of the same name is defined in this stimulus.
  • Possible values: The name of another defined stimulus

1
2
3
4
5
6
7
"t_a_1": {
  "type": "tokenized_audio",
  "content": ["a.mp3", "b.mp3", "c.mp3"],
  "hint": true,
  "key_advance": "j",
  "barrier": false
}
1
2
3
4
5
6
"t_a_2": {
  "type": "tokenized_audio",
  "content": ["d.mp3", "e.mp3", "f.mp3"],
  "parent": "t_a_1",
  "hint": false
}
Here, the t_a_2 stimulus inherits the barrier and key_advance properties of t_a_1. t_a_2 does not inherit the hint property of t_a_1 because the stimulus definition of t_a_2 has its own specified hint property.

progress_bar

  • Definition: Whether to display a progress bar to visually indicate how many audio files are left to be played
  • Possible values: true or false
  • Default: true
  • Setting this to false will result in no visual indication of the progress of the current tokenized-audio stimulus.
1
2
3
4
5
{
  "type": "tokenized_audio",
  "content": ["a.mp3", "b.mp3", "c.mp3"],
  "progress_bar": false
}

Sample 3 out of 6 audio clips:

1
2
3
4
5
{
  "type": "tokenized_audio",
  "content": ["clip1.mp3", "clip2.mp3", "clip3.mp3", "clip4.mp3", "clip5.mp3", "clip6.mp3"],
  "sampling": {"k": 3}
}
Setting "k": 3 randomly selects 3 of the 6 clips to present. Increasing k plays more clips; setting it to 0 disables sampling and plays all clips.

Sample 5 clips from a list of 4 clips with replacement:

1
2
3
4
5
{
  "type": "tokenized_audio",
  "content": ["clip1.mp3", "clip2.mp3", "clip3.mp3", "clip4.mp3"],
  "sampling": {"k": 5, "replacement": true}
}
With only 4 unique clips, setting "k": 5 would normally lead to an error. But here we set "replacement": true to allow the same clip to be played more than once, which is necessary when k exceeds the number of available clips.

Sample 4 clips with replacement and allow the same clip to play consecutively:

1
2
3
4
5
{
  "type": "tokenized_audio",
  "content": ["clip1.mp3", "clip2.mp3", "clip3.mp3", "clip4.mp3", "clip5.mp3", "clip6.mp3"],
  "sampling": {"k": 4, "replacement": true, "adjacent_duplicates": true}
}
With replacement enabled, the same clip can appear more than once overall. Setting "adjacent_duplicates": true additionally allows the same clip to play back-to-back. When false, consecutive duplicates are prevented.

self_paced

  • Definition: Whether participant interaction (in the form of a key-press specified by key_advance) is required to trigger the playing of each audio clip. If true, then the playing of audio clips is triggered by participant interaction, and reaction time for each audio clip is recorded. The recorded reaction time reflects how long participants spend listening to an audio clip. A reaction time shorter than the duration of an audio clip means that participants skipped to the next clip before the current one ended.
  • Possible values: true, false
  • Default: true

Note

At this time, only true is supported. Setting this to false will be ignored.

1
2
3
4
5
{
  "type": "tokenized_audio",
  "content": ["a.mp3", "b.mp3", "c.mp3"],
  "self_paced": true
}

See Also

Audio Stimulus, Tokenized Text Stimulus, Tokenized Image Stimulus