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
Android Documentation
BaseAudioDecoder

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)

Constructor 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)

Method Parameters

extractor
inputBuffer

onOutputBufferAvailable( ByteBuffer outputBuffer )

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

Method Parameters

outputBuffer

onOutputFormatChanged( MediaFormat mediaFormat )

protected void onOutputFormatChanged(MediaFormat mediaFormat)

Method Parameters

mediaFormat

onMediaCodecError( MediaCodec.CodecException e )

protected void onMediaCodecError(MediaCodec.CodecException e)

Method 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