PushAudioInputStream class

Represents memory backed push audio input stream used for custom audio input configurations.

Extends

Methods

close()

Closes the stream.

create(AudioStreamFormat)

Creates a memory backed PushAudioInputStream with the specified audio format.

createPullStream(PullAudioInputStreamCallback, AudioStreamFormat)

Creates a PullAudioInputStream that delegates to the specified callback interface for read() and close() methods.

createPushStream(AudioStreamFormat)

Creates a memory backed PushAudioInputStream with the specified audio format.

write(ArrayBuffer)

Writes the audio data specified by making an internal copy of the data.

Method Details

close()

Closes the stream.

function close()

create(AudioStreamFormat)

Creates a memory backed PushAudioInputStream with the specified audio format.

static function create(format?: AudioStreamFormat)

Parameters

format
AudioStreamFormat

The audio data format in which audio will be written to the push audio stream's write() method (currently only support 16 kHz 16bit mono PCM).

Returns

createPullStream(PullAudioInputStreamCallback, AudioStreamFormat)

Creates a PullAudioInputStream that delegates to the specified callback interface for read() and close() methods.

static function createPullStream(callback: PullAudioInputStreamCallback, format?: AudioStreamFormat)

Parameters

callback
PullAudioInputStreamCallback

The custom audio input object, derived from PullAudioInputStreamCallback

format
AudioStreamFormat

The audio data format in which audio will be returned from the callback's read() method (currently only support 16 kHz 16bit mono PCM).

Returns

createPushStream(AudioStreamFormat)

Creates a memory backed PushAudioInputStream with the specified audio format.

static function createPushStream(format?: AudioStreamFormat)

Parameters

format
AudioStreamFormat

The audio data format in which audio will be written to the push audio stream's write() method (currently only support 16 kHz 16bit mono PCM).

Returns

write(ArrayBuffer)

Writes the audio data specified by making an internal copy of the data.

function write(dataBuffer: ArrayBuffer)

Parameters

dataBuffer
ArrayBuffer

The audio buffer of which this function will make a copy.