Interface IAudioStreamListener
- Package
- com.smartdevicelink.streaming.audio
- All Known Implementing Classes
-
com.smartdevicelink.streaming.StreamPacketizer
Overview
A listener that receives audio streaming data from app.
Methods
sendAudio(
byte[] data,
int offset,
int length,
long presentationTimeUs
)
Sends a chunk of audio data to SDL Core.
Note: this method must not be called after SdlProxyBase.endAudioStream() is called.
public void sendAudio(byte[] data,int offset,int length,long presentationTimeUs) throws java.lang.ArrayIndexOutOfBoundsException
Method Parameters
- data
- Byte array containing audio data
- offset
- Starting offset in 'data'
- length
- Length of the data
- presentationTimeUs
- (Reserved for future use) Presentation timestamp (PTS) of the
last audio sample data included in this chunk, in microseconds.
It must be greater than the previous timestamp.
Specify -1 if unknown.
Throws
-
java.lang.ArrayIndexOutOfBoundsException
sendAudio(
ByteBuffer data,
long presentationTimeUs,
CompletionListener completionListener
)
Sends a chunk of audio data to SDL Core.
Note: this method must not be called after SdlProxyBase.endAudioStream() is called.
public void sendAudio(ByteBuffer data,long presentationTimeUs,CompletionListener completionListener)
Method Parameters
- data
- Data chunk to send. Its position will be updated upon return.
- presentationTimeUs
- (Reserved for future use) Presentation timestamp (PTS) of the
last audio sample data included in this chunk, in microseconds.
It must be greater than the previous timestamp.
Specify -1 if unknown.
- completionListener
- A completion listener that informs when the audio file is played
View on GitHub.com