SPAudioBuffer Class
Wrapper around AudioBuffer to support audio source caching and allowing clipping of audiobuffers to various lengths.
Constructor
SPAudioBuffer
-
audioContext
-
URL
-
startPoint
-
endPoint
-
[AudioBuffer]
Parameters:
-
audioContext
AudioContextWebAudio Context.
-
URL
String/AudioBuffer/FileThe source URL or File object or an AudioBuffer to encapsulate.
-
startPoint
NumberThe startPoint of the AudioBuffer in seconds.
-
endPoint
NumberThe endPoint of the AudioBuffer in seconds.
-
[AudioBuffer]
Object optionalaudioBuffer An AudioBuffer object incase the URL has already been downloaded and decoded.
Item Index
Methods
Properties
Methods
getChannelData
-
channel
Returns the Float32Array representing the PCM audio data for the specific channel.
Parameters:
-
channel
NumberThis parameter is an index representing the particular channel to get data for. An index value of 0 represents the first channel.
Properties
buffer
AudioBuffer
The actual AudioBuffer that this SPAudioBuffer object is wrapping around. The getter of this property returns a clipped AudioBuffer based on the startPoint and endPoint properties.
Default: null
endPoint
Number
The ending point of the buffer in seconds. This, along with the startPoint property, decides which part of the original buffer is clipped and returned by the getter of the buffer property.
Default: null
sourceURL
String/File
URL or File object that is the source of the sound in the buffer. This property can be used for indexing and caching decoded sound buffers.
Default: null