media/AudioBuffer. AudioBuffer

The AudioBuffer object provides sound recording and replaying to activities.

Constructor

new AudioBuffer(secondsopt)

AudioBuffer constructor

Parameters:
NameTypeAttributesDescription
secondsnumber<optional>

The maximum amount of time allowed to be recorded by this AudioBuffer

Members

chunks :Array.<external:Blob>

Array of data chunks collected during the recording

Type:
  • Array.<external:Blob>

enabled :boolean

AudioBuffer is enabled only in browsers with navigator.MediaDevices.getuserMedia

Type:
  • boolean

mediaPlayer :external:HTMLAudioElement

The HTML audio element used to play the recorded sound

mediaRecorder :external:MediaRecorder

The object used to record audio data and convert it to a valid stream for the ActiveMediaPlayer

playWhenFinished :boolean

Instructs this AudioBuffer recorder to start playing the collected audio at the end of the
current mediaRecorder task.

Type:
  • boolean

seconds :number

Maximum length of recordings allowed to this AudioBuffer (in seconds)

Type:
  • number

timeoutID :number

The identifier of the timer launched to stop the recording when the maximum time is exceeded.
This member is null when no timeout function is associated to this AudioBuffer

Type:
  • number

(static) MAX_RECORD_LENGTH :number

Maximum amount of time allowed for recordings (in seconds)

Type:
  • number

Methods

clear()

Clears all data associated to this AudioBuffer

play()

Starts playing the currently recorded audio, if any.

record($divopt)

Starts recording audio, or stops the recording if already started.

Parameters:
NameTypeAttributesDescription
$divexternal:jQuery<optional>

Optional div element where the recording is performed, as a jQuery ref.

stop()

Stops the current operation, either recording or playing audio

visualFeedbak(enabled, $divopt)

Set visual feedback to the user while the system is recording audio
Currently changes the cursor pointer associated to the HTML element
containing the recorder.

Parameters:
NameTypeAttributesDescription
enabledboolean

Flag indicating if the visual feedback should be active or inactive

$divexternal:jQuery<optional>

Optional div element where the recording is performed, as a jQuery ref.