AudioInputStream Class
- java.
lang. Object - com.
microsoft. cognitiveservices. speech. audio. AudioInputStream
- com.
Implements
public class AudioInputStream
implements java.lang.AutoCloseable
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
Modifier and Type | Method and Description |
---|---|
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. |
static
Pull |
createPullStream(PullAudioInputStreamCallback callback)
Creates a Pull |
static
Pull |
createPullStream(PullAudioInputStreamCallback callback, AudioStreamFormat format)
Creates a Pull |
static
Push |
createPushStream()
Creates a memory backed Push |
static
Push |
createPushStream(AudioStreamFormat format)
Creates a memory backed Push |
Safe |
getImpl()
Internally used to get the underlying native handle of the stream. |
Methods inherited from java.lang.Object
Method Details
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.
createPullStream
public static PullAudioInputStream createPullStream(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:
Returns:
createPullStream
public static PullAudioInputStream createPullStream(PullAudioInputStreamCallback callback, AudioStreamFormat format)
Creates a PullAudioInputStream that delegates to the specified callback interface for read() and close() methods.
Parameters:
Returns:
createPushStream
public static PushAudioInputStream createPushStream()
Creates a memory backed PushAudioInputStream using the default format (16 kHz, 16 bit, mono PCM).
Returns:
createPushStream
public static PushAudioInputStream createPushStream(AudioStreamFormat format)
Creates a memory backed PushAudioInputStream with the specified audio format.
Parameters:
Returns:
getImpl
public SafeHandle getImpl()
Internally used to get the underlying native handle of the stream.
Returns:
Applies to
Azure SDK for Java