Class PullAudioOutputStream
- java.lang.Object
-
- com.microsoft.cognitiveservices.speech.audio.AudioOutputStream
-
- com.microsoft.cognitiveservices.speech.audio.PullAudioOutputStream
-
- All Implemented Interfaces:
AutoCloseable
public final class PullAudioOutputStream extends AudioOutputStream
Represents memory backed push audio output stream used for custom audio output configurations.
-
-
Constructor Summary
Constructors Constructor Description PullAudioOutputStream(IntRef stream)Internal constructor for PullAudioOutputStream.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static PullAudioOutputStreamcreate()Creates a memory backed PullAudioOutputStream.longread(byte[] dataBuffer)Reads the audio data specified by making an internal copy of the data.-
Methods inherited from class com.microsoft.cognitiveservices.speech.audio.AudioOutputStream
close, createPullStream, createPushStream, getImpl
-
-
-
-
Constructor Detail
-
PullAudioOutputStream
public PullAudioOutputStream(IntRef stream)
Internal constructor for PullAudioOutputStream.- Parameters:
stream- the native handle of the audio output stream.
-
-
Method Detail
-
create
public static PullAudioOutputStream create()
Creates a memory backed PullAudioOutputStream.- Returns:
- The pull audio output stream being created.
-
read
public long read(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.- Parameters:
dataBuffer- The audio buffer of which this function will make a copy to.- Returns:
- The number of bytes filled, or 0 in case the stream hits its end and there is no more data available.
-
-