JavaScript

A5.audioRecorder Class

Arguments

settingsobject

Settings for the audio recorder. This will override the initial values of the properties of the A5.audio.Recorder class.

Description

Audio recorder class.

Properties

heartbeatnumber

Rate of heartbeat in seconds, "0" equals no heartbeat, the default in "0.25".

maxDurationnumber

Maximum duration of audio recording in seconds. A value of "0" or less allow for any recording duration.

fidelitystring

Recording fidelity. Values can be "very-high", "high", "medium", "low" and "very-low". The default is "medium".

onStartfunction()

Event for when recording is initiated.

onChangefunction()

Event fired when audio recorder state changes.

onPausefunction()

Event fired when recording is paused.

onResumefunction()

Event fired when recording is resumed.

onMaximumfunction()

Event fired when the recording hits the maximum duration and is paused. If you define this event, you must either use A5.audio.Recorder.save() or A5.audio.Recorder.cancel() to complete the recording. If the event is not defined, then the recording will be saved with an automatically generated name.

onSavedfunction()

Event fired when the recording is done, and the file is saved.

srcstring

The full source URL of the recording.

onErrorfunction()

Event fired when there is an error with the recording.

onDonefunction(data)

Event fired when the recording is done, regardless of if it succeeded or failed.

dataobject

The data for that done event

typestring

The type of done event. "cancel" if the user canceled the recording and it was not saved, "save" if the recording is saved.

stateobject

The state of the audio player. State is updated by audio events, if you want to refresh "stale" state information use the A5.audio.Player.getState() method.

activeboolean

Whether recording is currently active.

srcstringboolean

The source of the last successfully saved recording. Once an new recording is started, the value will be set to "false".

recordingboolean

Whether recording is currently active and not paused.

levelnumber

Level of recording volume between 0.0 and 1.0. Note: this is not acurate, but gives an idea of the recording.

currentnumber

Current recording time in seconds.

durationnumber

Maximum allowed duration of the recording in seconds.

Methods

cancel Method

Stop the current recording and do not save.

getState Method

Refresh and return the state of the A5.audio.Recorder.

pause Method

Pause the current recording.

resume Method

Resume the current recording.

save Method

Stop the current recording and save the resulting file. The file will be saved as a "*.M4A".

start Method

Start a recording.

See Also