问题
In an embedded (Windows CE) C++ project, I have to resample an arbitrary sample-rate down (or up) to 44100 Hz.
Is there a free and portable C/C++ library for audio resampling?
回答1:
This page lists a bunch of options.
Formatted exert, for the records. Please check out the above link for important details and licence information:
libresample
andsndfile-resample
(fromlibsamplerate
) (in the Planet CCRMA Distribution).libsoxr
, the SoX resampler libraryssrc
(from Shibatch)- There is a project combining ssrc and sox
- New in 2016 is a Python (Cython) implementation: resampy
- Brick (on Github).
- Smarc, available as a command-line program or C library.
- The resample software package contains free sampling-rate conversion and filter design utilities written in C.
- Older Version for NeXT Computers.
- Original 1983+ source for the PDP KL-10.
- Erik de Castro Lopo's "SecretRabbitCode" libsamplerate
libresample based on `resample-1.7P
libresample4j is a Java port of
libresample
.- Open Source Audio Library Project (OSALP) contains a C++ class based on
resample
. - The Speex speech coder/decoder.
- More at another large list of implementations and their relative performance.
回答2:
Here's a code example using FFMpeg (avcodec) directly from C:
http://tdistler.com/2010/07/22/audio-resampling-using-ffmpeg-avcodec
来源:https://stackoverflow.com/questions/4009737/library-for-audio-resampling