Class PullAudioInputStream
- java.lang.Object
-
- com.microsoft.cognitiveservices.speech.audio.AudioInputStream
-
- com.microsoft.cognitiveservices.speech.audio.PullAudioInputStream
-
- All Implemented Interfaces:
AutoCloseable
public final class PullAudioInputStream extends AudioInputStream
Represents 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
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description voidclose()Explicitly frees any external resource attached to the object Note: close() must be called in order to release underlying resources held by the object.static PullAudioInputStreamcreate(PullAudioInputStreamCallback callback)Creates a PullAudioInputStream that delegates to the specified callback interface for read() and close() methods, using the default format (16 kHz, 16 bit, mono PCM).static PullAudioInputStreamcreate(PullAudioInputStreamCallback callback, AudioStreamFormat format)Creates a PullAudioInputStream that delegates to the specified callback interface for read() and close() methods.-
Methods inherited from class com.microsoft.cognitiveservices.speech.audio.AudioInputStream
createPullStream, createPullStream, createPushStream, createPushStream, getImpl
-
-
-
-
Method Detail
-
create
public static PullAudioInputStream create(PullAudioInputStreamCallback callback)
Creates a PullAudioInputStream that delegates to the specified callback interface for read() and close() methods, using the default format (16 kHz, 16 bit, mono PCM).- Parameters:
callback- The custom audio input object, derived from PullAudioInputStreamCustomCallback- Returns:
- The push audio input stream being created.
-
create
public static PullAudioInputStream create(PullAudioInputStreamCallback callback, AudioStreamFormat format)
Creates a PullAudioInputStream that delegates to the specified callback interface for read() and close() methods.- Parameters:
callback- The custom audio input object, derived from PullAudioInputStreamCustomCallbackformat- The audio data format in which audio will be returned from the callback's read() method.- Returns:
- The push audio input stream being created.
-
close
public void close()
Explicitly frees any external resource attached to the object Note: close() must be called in order to release underlying resources held by the object.- Specified by:
closein interfaceAutoCloseable- Overrides:
closein classAudioInputStream
-
-