Class MediaAudioDecoder
java.lang.Object
javaforce.media.MediaCoder
javaforce.media.MediaAudioDecoder
-
Field Summary
Fields inherited from class MediaCoder
AUDIO_FRAME, AV_CODEC_ID_AAC, AV_CODEC_ID_AC3, AV_CODEC_ID_DEFAULT, AV_CODEC_ID_FLAC, AV_CODEC_ID_GSM_MS, AV_CODEC_ID_H263, AV_CODEC_ID_H264, AV_CODEC_ID_H265, AV_CODEC_ID_MP2, AV_CODEC_ID_MP3, AV_CODEC_ID_MPEG1VIDEO, AV_CODEC_ID_MPEG2VIDEO, AV_CODEC_ID_MPEG4, AV_CODEC_ID_NONE, AV_CODEC_ID_OPUS, AV_CODEC_ID_PCM_S16LE, AV_CODEC_ID_SPEEX, AV_CODEC_ID_THEORA, AV_CODEC_ID_VORBIS, AV_CODEC_ID_VP8, AV_CODEC_ID_VP9, AV_FORMAT_ID_AVI, AV_FORMAT_ID_MKV, AV_FORMAT_ID_MOV, AV_FORMAT_ID_MP1, AV_FORMAT_ID_MP2, AV_FORMAT_ID_MP4, AV_FORMAT_ID_OGG, AV_FORMAT_ID_WAV, AV_FORMAT_ID_WEBM, ctx, debug, END_FRAME, NULL_FRAME, PROFILE_BASELINE, PROFILE_HIGH, PROFILE_MAIN, SEEK_CUR, SEEK_END, SEEK_SET, shared, VIDEO_FRAME -
Constructor Summary
ConstructorsConstructorDescriptionCreate a stand-alone audio decoder for raw audio.MediaAudioDecoder(MediaInput input) Create an audio decoder for a stream in a container format. -
Method Summary
Modifier and TypeMethodDescriptionbooleanChanges output chs/freq only.short[]decode(byte[] data, int offset, int length) Decodes codec packet into raw audio frame.short[]Decodes codec packet into raw audio frame.intReturns number of audio channels.intReturns audio sample rate.booleanstart(int codec_id, int new_chs, int new_freq) Starts a stand-alone audio decoder.voidstop()Stops a stand-alone audio decoder.Methods inherited from class MediaCoder
getStream, init, isRunning, setLogging, setStream
-
Constructor Details
-
MediaAudioDecoder
public MediaAudioDecoder()Create a stand-alone audio decoder for raw audio. -
MediaAudioDecoder
Create an audio decoder for a stream in a container format.
-
-
Method Details
-
start
public boolean start(int codec_id, int new_chs, int new_freq) Starts a stand-alone audio decoder. -
stop
public void stop()Stops a stand-alone audio decoder. -
decode
public short[] decode(byte[] data, int offset, int length) Decodes codec packet into raw audio frame. -
decode
Decodes codec packet into raw audio frame. -
getChannels
public int getChannels()Returns number of audio channels. -
getSampleRate
public int getSampleRate()Returns audio sample rate. -
change
Changes output chs/freq only. All other fields ignored.
-