AudioRecording

Object containing all data needed to render a full audio recording.

Methods

async finalize()

Stops recording any future audio data within the AudioRecording, finalizes the internal storage of all recorded data, and calls the user-completion notification callback, if registered.

Note that this function is called automatically if the original call to recordOutput() specified a concrete duration for the recording. If no duration was specified, then this function must be called in order to stop recording. An AudioRecording is unable to be used or played back until this function has been called.

async finalize()

Stops recording any future audio data within the AudioRecording, finalizes the internal storage of all recorded data, and calls the user-completion notification callback, if registered.

Note that this function is called automatically if the original call to recordOutput() specified a concrete duration for the recording. If no duration was specified, then this function must be called in order to stop recording. An AudioRecording is unable to be used or played back until this function has been called.

getDuration() → {number}

Returns the total duration of the audio recording in seconds.

Returns:
number -

Duration of the audio recording in seconds

getDuration() → {number}

Returns the total duration of the audio recording in seconds.

Returns:
number -

Duration of the audio recording in seconds

async getEncodedData(encodingType) → {Blob}

Encodes this AudioRecording into a Blob containing raw audio data according to the EncodingType specified in the encodingType parameter.

Parameters:
Name Type Description
encodingType number

Numeric value corresponding to the desired EncodingType

Returns:
Blob -

Data Blob containing the newly encoded audio data

See:

async getEncodedData(encodingType) → {Blob}

Encodes this AudioRecording into a Blob containing raw audio data according to the EncodingType specified in the encodingType parameter.

Parameters:
Name Type Description
encodingType number

Numeric value corresponding to the desired EncodingType

Returns:
Blob -

Data Blob containing the newly encoded audio data

See:

getRawData() → {Blob}

Returns a Blob containing all of the recorded audio data.

Returns:
Blob -

Buffer containing all recorded audio data

getRawData() → {Blob}

Returns a Blob containing all of the recorded audio data.

Returns:
Blob -

Buffer containing all recorded audio data

notifyWhenComplete(notificationCallback)

Allows a user to register a callback for notification when all audio recording activities have been completed for this AudioRecording. This corresponds to the time when the finalize() function gets called, either manually or automatically.

A user-defined notification callback will be called with a single parameter which is a reference to this AudioRecording.

Parameters:
Name Type Description
notificationCallback RecordCompleteCallback

Callback to fire when this recording has completed

notifyWhenComplete(notificationCallback)

Allows a user to register a callback for notification when all audio recording activities have been completed for this AudioRecording. This corresponds to the time when the finalize() function gets called, either manually or automatically.

A user-defined notification callback will be called with a single parameter which is a reference to this AudioRecording.

Parameters:
Name Type Description
notificationCallback RecordCompleteCallback

Callback to fire when this recording has completed

AudioRecording

Object containing all data needed to render a full audio recording.

Methods

async finalize()

Stops recording any future audio data within the AudioRecording, finalizes the internal storage of all recorded data, and calls the user-completion notification callback, if registered.

Note that this function is called automatically if the original call to recordOutput() specified a concrete duration for the recording. If no duration was specified, then this function must be called in order to stop recording. An AudioRecording is unable to be used or played back until this function has been called.

async finalize()

Stops recording any future audio data within the AudioRecording, finalizes the internal storage of all recorded data, and calls the user-completion notification callback, if registered.

Note that this function is called automatically if the original call to recordOutput() specified a concrete duration for the recording. If no duration was specified, then this function must be called in order to stop recording. An AudioRecording is unable to be used or played back until this function has been called.

getDuration() → {number}

Returns the total duration of the audio recording in seconds.

Returns:
number -

Duration of the audio recording in seconds

getDuration() → {number}

Returns the total duration of the audio recording in seconds.

Returns:
number -

Duration of the audio recording in seconds

async getEncodedData(encodingType) → {Blob}

Encodes this AudioRecording into a Blob containing raw audio data according to the EncodingType specified in the encodingType parameter.

Parameters:
Name Type Description
encodingType number

Numeric value corresponding to the desired EncodingType

Returns:
Blob -

Data Blob containing the newly encoded audio data

See:

async getEncodedData(encodingType) → {Blob}

Encodes this AudioRecording into a Blob containing raw audio data according to the EncodingType specified in the encodingType parameter.

Parameters:
Name Type Description
encodingType number

Numeric value corresponding to the desired EncodingType

Returns:
Blob -

Data Blob containing the newly encoded audio data

See:

getRawData() → {Blob}

Returns a Blob containing all of the recorded audio data.

Returns:
Blob -

Buffer containing all recorded audio data

getRawData() → {Blob}

Returns a Blob containing all of the recorded audio data.

Returns:
Blob -

Buffer containing all recorded audio data

notifyWhenComplete(notificationCallback)

Allows a user to register a callback for notification when all audio recording activities have been completed for this AudioRecording. This corresponds to the time when the finalize() function gets called, either manually or automatically.

A user-defined notification callback will be called with a single parameter which is a reference to this AudioRecording.

Parameters:
Name Type Description
notificationCallback RecordCompleteCallback

Callback to fire when this recording has completed

notifyWhenComplete(notificationCallback)

Allows a user to register a callback for notification when all audio recording activities have been completed for this AudioRecording. This corresponds to the time when the finalize() function gets called, either manually or automatically.

A user-defined notification callback will be called with a single parameter which is a reference to this AudioRecording.

Parameters:
Name Type Description
notificationCallback RecordCompleteCallback

Callback to fire when this recording has completed