public interface IAudioPlayback extends IInvocable
IAudioPlayback
- audio playback interface. It is responsible for PCM data playback.IInvocable.Method
Modifier and Type | Method and Description |
---|---|
java.lang.String |
getName() |
AudioTrackInfo |
getTrackInfo() |
boolean |
isStarted()
Checks if audio playback is started.
|
void |
start(AudioTrackInfo audioTrackInfo,
int bufferSize)
Opens and starts audio playback stream.
|
void |
stop()
Stops and closes audio playback.
|
void |
write(FloatArray[] pcm)
Writes audio
pcm to be played. |
invoke
java.lang.String getName()
AudioTrackInfo getTrackInfo()
null
if source is not started yetboolean isStarted()
true
if playback is startedvoid start(AudioTrackInfo audioTrackInfo, int bufferSize) throws java.lang.Exception
Note:
- The playback can choose other track format to use.
audioTrackInfo
- audio track format to usebufferSize
- desired buffer size, if negative then the default buffer size is usedjava.lang.Exception
- if an exception occurredvoid write(FloatArray[] pcm) throws java.lang.Exception
pcm
to be played.pcm
- audio pcm to be playedjava.lang.Exception
- if an exception occurredvoid stop() throws java.lang.Exception
java.lang.Exception
- if an exception occurred