Expand Minimize Picture-in-picture Power Device Status Voice Recognition Skip Back Skip Forward Minus Plus Play Search
Internet Explorer alert
This browser is not recommended for use with smartdevicelink.com, and may not function properly. Upgrade to a different browser to guarantee support of all features.
close alert
To Top Created with Sketch. To Top
To Bottom Created with Sketch. To Bottom
JavaSE Documentation
IAudioStreamListener

Interface IAudioStreamListener

Package
com.smartdevicelink.streaming.audio

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
Previous Section Next Section