AudioDataStream Class

Definition

Represents audio data stream used for operating audio data as a stream. Added in version 1.7.0

public class AudioDataStream
Inheritance
java.lang.Object
Closeable
AudioDataStream

Methods

canReadData(long bytesRequested)

Check whether the stream has enough data to be read.

canReadData(long pos, long bytesRequested)

Check whether the stream has enough data to be read, starting from the specified position.

close()

Dispose of associated resources.

detachInput()

Stops any more data from getting to the stream.

fromResult(KeywordRecognitionResult result)

Obtains the memory backed AudioDataStream associated with a given KeywordRecognition result.

fromResult(SpeechSynthesisResult result)

Creates a memory backed AudioDataStream from given speech synthesis result.

getPosition()

Get current position of the audio data stream.

getProperties()

The collection of properties and their values defined for this audio data stream.

getStatus()

Get current status of the audio data stream.

readData(byte[] dataBuffer)

Reads the audio data specified by making an internal copy of the data. The maximal number of bytes to be read is determined by the size of dataBuffer. If there is no data immediately available, read() blocks until the next data becomes available.

readData(long pos, byte[] dataBuffer)

Reads the audio data specified by making an internal copy of the data, starting from the specified position. The maximal number of bytes to be read is determined by the size of dataBuffer. If there is no data immediately available, read() blocks until the next data becomes available.

saveToWavFile(String fileName)

Save the audio data to a file, synchronously.

saveToWavFileAsync(String fileName)

Save the audio data to a file, asynchronously.

setPosition(long pos)

Set current position of the audio data stream.

Applies to