How to convert sample rate from AV_SAMPLE_FMT_FLTP to AV_SAMPLE_FMT_S16?
问题 I am decoding aac to pcm with ffmpeg with avcodec_decode_audio3. However it decodes into AV_SAMPLE_FMT_FLTP sample format (PCM 32bit Float Planar) and i need AV_SAMPLE_FMT_S16 (PCM 16 bit signed - S16LE). I know that ffmpeg can do this easily with -sample_fmt. I want to do the same with the code but i still couldn't figure it out. audio_resample did not work for: it fails with error message: .... conversion failed. 回答1: EDIT 9th April 2013 : Worked out how to use libswresample to do this...