[Libav-user] Changing the sample rate of a resampling filter on the fly.

Peter Spierenburg peter.spierenburg at nautel.com
Tue Sep 27 18:31:56 EEST 2016


I have an application where I need to control the output sample rate of an audio resampling filter on the fly, with parts-per-million resolution.

I've found an example that gets close at:


I've even managed to convince it to accept arbitrary sample rates with parts-per-million resolution. To be fair, I cannot hear the difference between 64000 samples per second and 64000.000001 samples per second. But I can hear the difference between 64000 samples per second and 40100 samples per second.

What I need to figure out is:

- Is it possible to change the resample rate of the aformat filter (lines 61-72) on the fly somewhere in the audio_decode_frame() function?

- Does the aformat filter actually output fractional sample rates, or merely round to the nearest integer rate?

- Is there a filter that is better suited to this task?


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://ffmpeg.org/pipermail/libav-user/attachments/20160927/c9cd26f6/attachment.html>

More information about the Libav-user mailing list