Aracılığıyla paylaş


PushAudioInputStream Class

public final class PushAudioInputStream
extends AudioInputStream

Represents memory backed push audio input stream used for custom audio input configurations. Note: close() must be called in order to release underlying resources held by the object.

Method Summary

Modifier and Type Method and Description
void close()

Closes the stream.

static PushAudioInputStream create()

Creates a memory backed PushAudioInputStream using the default format (16 kHz, 16 bit, mono PCM).

static PushAudioInputStream create(AudioStreamFormat format)

Creates a memory backed PushAudioInputStream with the specified audio format.

void write(byte[] dataBuffer)

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

Methods inherited from AudioInputStream

Methods inherited from java.lang.Object

java.lang.Object.clone java.lang.Object.equals java.lang.Object.finalize java.lang.Object.getClass java.lang.Object.hashCode java.lang.Object.notify java.lang.Object.notifyAll java.lang.Object.toString java.lang.Object.wait java.lang.Object.wait java.lang.Object.wait

Method Details

close

public void close()

Closes the stream. Note: close() must be called in order to release underlying resources held by the object.

Overrides:

PushAudioInputStream.close()

create

public static PushAudioInputStream create()

Creates a memory backed PushAudioInputStream using the default format (16 kHz, 16 bit, mono PCM).

Returns:

The push audio input stream being created.

create

public static PushAudioInputStream create(AudioStreamFormat format)

Creates a memory backed PushAudioInputStream with the specified audio format.

Parameters:

format - The audio data format in which audio will be written to the push audio stream's write() method.

Returns:

The push audio input stream being created.

write

public void write(byte[] dataBuffer)

Writes the audio data specified by making an internal copy of the data. Note: The dataBuffer should not contain any audio header.

Parameters:

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

Applies to