Agora Java API Reference for Android
Public Member Functions | List of all members
io.agora.rtc.audio.MediaCodecAudioDecoder Class Reference

Public Member Functions

boolean createStreaming (String filename)
 
int getChannelCount ()
 
int getSampleRate ()
 
long getFileLength ()
 
long getCurrentFilePosition ()
 
void setCurrentFilePosition (long position)
 
boolean getDecodeDataReadyFlag ()
 
void releaseStreaming ()
 
void rewindStreaming ()
 
boolean decodeFrame ()
 
boolean checkAACSupported ()
 
boolean createAACStreaming (int sample_rate)
 
void releaseAACStreaming ()
 
int decodeAACFrame (byte[] encoded_data)
 

Detailed Description

Simplifies the MediaCodec interface by wrapping around the buffer processing operations.

Member Function Documentation

◆ createStreaming()

boolean io.agora.rtc.audio.MediaCodecAudioDecoder.createStreaming ( String  filename)

Open the audio file

◆ getChannelCount()

int io.agora.rtc.audio.MediaCodecAudioDecoder.getChannelCount ( )
Returns
number of channels of the audio file

◆ getSampleRate()

int io.agora.rtc.audio.MediaCodecAudioDecoder.getSampleRate ( )
Returns
sample rate of the audio file

◆ getFileLength()

long io.agora.rtc.audio.MediaCodecAudioDecoder.getFileLength ( )
Returns
length of the audio file in micro seconds

◆ getCurrentFilePosition()

long io.agora.rtc.audio.MediaCodecAudioDecoder.getCurrentFilePosition ( )
Returns
current position within the audio file

◆ setCurrentFilePosition()

void io.agora.rtc.audio.MediaCodecAudioDecoder.setCurrentFilePosition ( long  position)

set current position within the audio file

◆ getDecodeDataReadyFlag()

boolean io.agora.rtc.audio.MediaCodecAudioDecoder.getDecodeDataReadyFlag ( )
Returns
whether decoded pcm data is ready for read out

◆ releaseStreaming()

void io.agora.rtc.audio.MediaCodecAudioDecoder.releaseStreaming ( )

Releases resources and ends the encoding/decoding session.

◆ rewindStreaming()

void io.agora.rtc.audio.MediaCodecAudioDecoder.rewindStreaming ( )

Reset the pointer to the beginning of the file

◆ decodeFrame()

boolean io.agora.rtc.audio.MediaCodecAudioDecoder.decodeFrame ( )

Decode a frame of audio data, return it in mOutputBuffers

◆ checkAACSupported()

boolean io.agora.rtc.audio.MediaCodecAudioDecoder.checkAACSupported ( )

Below code are for the hardware aac decoding

Returns
whether hardware AAC decoder is supported

◆ createAACStreaming()

boolean io.agora.rtc.audio.MediaCodecAudioDecoder.createAACStreaming ( int  sample_rate)

Open the stream for decoding

◆ releaseAACStreaming()

void io.agora.rtc.audio.MediaCodecAudioDecoder.releaseAACStreaming ( )

Releases resources and ends the encoding/decoding session.

◆ decodeAACFrame()

int io.agora.rtc.audio.MediaCodecAudioDecoder.decodeAACFrame ( byte []  encoded_data)

Decode a frame of audio data, return it in mOutputBuffers