Triton Mobile SDK for Android 3.5.1
This is a custom android player made by Triton Digital
Loading...
Searching...
No Matches
com.tritondigital.net.streaming.proxy.decoder.StreamContainerDecoder.AudioDataDecodedListener Interface Reference

Interface definition for a callback to be invoked when new metadata is decoded from the stream. More...

Public Member Functions

void onAudioConfigDecoded (AudioConfig audioConfig)
 
void onAudioDataDecoded (byte[] audioData, int audioDataLength, int timestamp)
 Audio data packet has been decoded from the stream.
 

Detailed Description

Interface definition for a callback to be invoked when new metadata is decoded from the stream.

Methods on this listener may be invoked from a secondary thread. The class implementing this listener should be thread-safe.

Member Function Documentation

◆ onAudioConfigDecoded()

void com.tritondigital.net.streaming.proxy.decoder.StreamContainerDecoder.AudioDataDecodedListener.onAudioConfigDecoded ( AudioConfig  audioConfig)

All parameters in the stream (typically in some headers or in the first packet(s) received after the connection is established) have been decoded. Those parameters are passed by the source of the stream to indicate how to use the stream data.

This method is called prior to the first call to onAudioDataDecoded, unless the stream transport protocol does not include any parameters.

◆ onAudioDataDecoded()

void com.tritondigital.net.streaming.proxy.decoder.StreamContainerDecoder.AudioDataDecodedListener.onAudioDataDecoded ( byte[]  audioData,
int  audioDataLength,
int  timestamp 
)

Audio data packet has been decoded from the stream.

Listener should use the AudioConfig received in the call to onAudioConfigDecoded received before to interpret the audio data correctly.

Parameters
audioDataThe chunk of data exactly as extracted from the stream (this is a complete chunk that was present in a single packet of the stream container). The buffer audioData might be reused later on, so it is the responsibility of the listener to copy it if it needs to keep it for long term.
audioDataLengthThe length of the chunk in the audioData bytes array. To minimise the allocation and copy of memory, the decoding buffer might be reused to store less data than the previous buffer.
timestampThe time stamp at which the data should be played. Typically extracted from the header of the packet containing the audio data. Time stamp is in milliseconds, stating at 0 for the first packet.

The documentation for this interface was generated from the following file: