Question

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?

Was it helpful?

Solution

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

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top