I am receiving audio data in RTP
stream. The audio can be either in G711 A-law
or u-law
depending on the source. How to decode the audio byte stream using ffmpeg
api's? Can ALSA
on Linux directly play the G711
audio format?
Libav for sure supports G.711. The associated codec ID are AV_CODEC_ID_PCM_MULAW
and AV_CODEC_ID_PCM_ALAW
. I suggest you start from the example program they provide and modify audio_decode_example()
in order to use G.711.
avcodec.h: http://libav.org/doxygen/master/avcodec_8h.html
libav example: http://libav.org/doxygen/master/avcodec_8c-example.html
https://stackoverflow.com/questions/23429634/can-ffmpeg-decode-g711-audio