Skip to content

ArrayAudioSource

Audio source that supplies PCM samples on demand.

new ArrayAudioSource(
data:
| number[]
| Float32Array<ArrayBufferLike>
| Float32Array<ArrayBufferLike>[]
| number[][],
sampleRate: number,
id?: string): ArrayAudioSource;
ParameterType
data| number[] | Float32Array<ArrayBufferLike> | Float32Array<ArrayBufferLike>[] | number[][]
sampleRatenumber
id?string

ArrayAudioSource

PropertyModifierTypeDescription
channelCountreadonlynumberNumber of audio channels.
durationreadonlynumberTotal duration in seconds.
idreadonlystringStable identifier for caching computed STFT frames.
sampleRatereadonlynumberSample rate in Hz.
getChannelData(channel: number): Float32Array;
ParameterType
channelnumber

Float32Array


read(options: object): Float32Array;

Reads PCM samples for a specific channel and time range.

ParameterTypeDescription
options{ channel: number; endTime: number; startTime: number; }Channel index and time span in seconds.
options.channelnumber-
options.endTimenumber-
options.startTimenumber-

Float32Array

Float32Array of normalized audio samples.

AudioSource.read