mmir.env.media.Html5AudioOutput
Audio handling for web / HTML5 environment
Requires
- module:window.URL
Members
-
protected,readonly_pluginName
-
- Default Value:
- "webAudio"
-
Media error (codes): the corresponding code is their
index.Code 0 is an internal error code for unknown/unspecific error causes.
Codes 1 - 4 correspond to the HTML5 MediaError interface (which are the same as Cordova's Audio MediaError codes). The description texts are taken from the HTML5 documentation.
Methods
-
getAudio()
-
Get an audio object for the audio file specified by URL URL or by WAV data. NOTE that getWAVAsAudio may not be supported by all modules! Convenience function for
getURLAsAudioandgetWAVAsAudio: if first argument is a String, thengetURLAsAudiowill be invoked, otherwisegetWAVAsAudio(if the module supports this function). -
getURLAsAudio(url, onPlayedCallback, failureCallback, onLoadedCallback){mmir.env.media.IAudio}
-
Get an audio object for the audio file specified by URL. The audio object exports the following functions:
play() stop() release() enable() disable() setVolume(number) getDuration() isPaused() isEnabled()
NOTE: the audio object should only be used, after theonLoadedCallbackwas triggered.Name Type Description urlString onPlayedCallbackfunction optional OPTIONAL failureCallbackfunction optional OPTIONAL onLoadedCallbackfunction optional OPTIONAL Returns:
Type Description mmir.env.media.IAudio the audio -
getWAVAsAudio()
-
- See:
-
- mmir.MediaManager#getWAVAsAudio
-
initialize()
-
-
play()
-
playURL()
-
Play audio file from the specified URL.
-
playWAV()
-
Play PCM audio data.