Expand Minimize Picture-in-picture Power Device Status Voice Recognition Skip Back Skip Forward Minus Plus Play Search
Documentation
Sidebar

Class BaseAudioDecoder

Hierarchy

java.lang.Object

Package
com.smartdevicelink.managers.audio
All Known Subclasses
com.smartdevicelink.managers.audio.AudioDecoder, com.smartdevicelink.managers.audio.AudioDecoderCompat

Fields

targetSampleRate

protected final int targetSampleRate

targetSampleType

protected final int targetSampleType

extractor

protected android.media.MediaExtractor extractor

decoder

protected android.media.MediaCodec decoder

audioSource

protected final android.net.Uri audioSource

contextWeakReference

protected final java.lang.ref.WeakReference contextWeakReference

listener

protected final com.smartdevicelink.managers.audio.AudioDecoderListener listener

Constructors

BaseAudioDecoder( Uri audioSource, Context context, int sampleRate, int sampleType, AudioDecoderListener listener )

public BaseAudioDecoder(Uri audioSource,Context context,int sampleRate,int sampleType,AudioDecoderListener listener)

Parameters

audioSource
Uri of the audio source to be converted
context
the context
sampleRate
can be either 8000, 16000, 22050 or 44100
sampleType
can be either UNSIGNED_8_BIT, SIGNED_16_BIT, FLOAT
listener
listener for event callbacks

Methods

initMediaComponents()

protected void initMediaComponents() throws java.lang.Exception

Throws

  • java.lang.Exception

onInputBufferAvailable( MediaExtractor extractor, ByteBuffer inputBuffer )

protected android.media.MediaCodec.BufferInfo onInputBufferAvailable(MediaExtractor extractor,ByteBuffer inputBuffer)

Parameters

extractor
inputBuffer

onOutputBufferAvailable( ByteBuffer outputBuffer )

protected com.smartdevicelink.managers.audio.SampleBuffer onOutputBufferAvailable(ByteBuffer outputBuffer)

Parameters

outputBuffer

onOutputFormatChanged( MediaFormat mediaFormat )

protected void onOutputFormatChanged(MediaFormat mediaFormat)

Parameters

mediaFormat

onMediaCodecError( MediaCodec.CodecException e )

protected void onMediaCodecError(MediaCodec.CodecException e)

Parameters

e

start()

public abstract void start()

stop()

public void stop()

Inherited Methods

From Class Methods
java.lang.Object getClass, hashCode, equals, clone, toString, notify, notifyAll, wait, wait, wait, finalize
View on GitHub.com
Previous Section Next Section