Class: AudioClip

sound.AudioClip(options)

new AudioClip(options)

AudioClip encapsulates an audio recording.

Parameters:
Name Type Description
options Object
Properties
Name Type Attributes Default Description
psychoJS module:core.PsychoJS the PsychoJS instance
name String <optional>
'audioclip' the name used when logging messages
format string the format for the audio file
sampleRateHz number the sampling rate
data Blob the audio data, in the given format, at the given sampling rate
autoLog boolean <optional>
false whether or not to log
Source:

Members

(readonly) Engine :Symbol

Recognition engines.
Type:
  • Symbol
Source:

Methods

download()

Offer the audio clip to the participant as a sound file to download.
Source:

getDuration() → {Promise.<number>}

Get the duration of the audio clip, in seconds.
Source:
Returns:
the duration of the audio clip
Type
Promise.<number>

setVolume(volume)

Set the volume of the playback.
Parameters:
Name Type Description
volume number the volume of the playback (must be between 0.0 and 1.0)
Source:

startPlayback()

Start playing the audio clip.
Source:

startPlayback(fadeDurationopt)

Stop playing the audio clip.
Parameters:
Name Type Attributes Default Description
fadeDuration number <optional>
17 how long the fading out should last, in ms
Source:

upload()

Upload the audio clip to the pavlovia server.
Source: