[Libav-user] "Clicks" after resampling pcm

Igor R boost.lists at gmail.com
Mon Oct 17 23:52:51 CEST 2011


I receive from a network an AMR audio stream, which I decode with
avcodec_decode_audio3(). For some reason, I get pcm with
SAMPLE_FMT_FLT sampling, which I have to resample to SAMPLE_FMT_S16:
ReSampleContext *resampleCtx = av_audio_resample_init(1, 1, 8000,
8000, SAMPLE_FMT_S16, SAMPLE_FMT_FLT, 16, 10, 0, 1);
audio_resample(resampleCtx, (short *)pcm, (short *)pcm, sampleCount);

During the above process I store 3 streams to files: the original amr
- to *.amr file, the pcm before resampling - to *.wav, and the final
pcm - to another *.wav.
All the three files play similar sound, but the latter one have very
sharp periodic clicks.
What can be wrong in the above resampling procedure?


More information about the Libav-user mailing list