Audio Class
Audio class is used to store audio data as a arraybuffer to be later used by objects with the WebAudio API.
Item Index
Methods
- fileIsAudio static
- getAudioBuffer
- toJSON
Methods
fileIsAudio
(
Boolean
static
-
file
Check if a file name refers to a supported audio file.
Parameters:
-
file
File
Returns:
Boolean:
True if the file refers to a supported audio format.
getAudioBuffer
(
-
context
-
callback
Get an WebAudio buffer to play the audio stored in this resources.
This method is asyncronous and the value is returned using a callback function.
Parameters:
-
context
AudioContextWebAudio context used to decode the audio data.
-
callback
FunctionCallback funtion that receives an audio buffer as argument.
toJSON
(
Object
-
meta
Serialize audio data as json.
Audio data is serialized in Base64.
Parameters:
-
meta
Meta
Returns:
Object:
data