PullAudioInputStreamCallback Class
- java.
lang. Object - com.
microsoft. cognitiveservices. speech. audio. PullAudioInputStreamCallback
- com.
public abstract class PullAudioInputStreamCallback
An abstract base class that defines callback methods (read() and close()) for custom audio input streams).
Constructor Summary
Constructor | Description | |
---|---|---|
PullAudioInputStreamCallback() |
Method Summary
Modifier and Type | Method and Description |
---|---|
abstract void |
close()
Closes the audio input stream. |
java.lang.String |
getProperty(PropertyId id)
Get property associated to data buffer, such as a timestamp or user |
abstract int |
read(byte[] dataBuffer)
Reads data from audio input stream into the data buffer. |
Methods inherited from java.lang.Object
Constructor Details
PullAudioInputStreamCallback
public PullAudioInputStreamCallback()
Method Details
close
public abstract void close()
Closes the audio input stream.
getProperty
public String getProperty(PropertyId id)
Get property associated to data buffer, such as a timestamp or userId. If the property is not available, an empty string must be returned. Added in version 1.5.0
Parameters:
Returns:
read
public abstract int read(byte[] dataBuffer)
Reads data from audio input stream into the data buffer. 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. Note: The dataBuffer returned by read() should not contain any audio header.
Parameters:
Returns:
Applies to
Azure SDK for Java
Feedback
https://aka.ms/ContentUserFeedback.
Coming soon: Throughout 2024 we will be phasing out GitHub Issues as the feedback mechanism for content and replacing it with a new feedback system. For more information see:Submit and view feedback for