Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Library for audio resampling

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?

like image 511
lornova Avatar asked Oct 24 '10 18:10

lornova


People also ask

Can I compare the performance of this resampler library to another library?

Speed performance when converting to other sample rates may vary greatly. When comparing performance of this resampler library to another library make sure that the competing library is also tuned to produce a fully linear-phase response, has similar stop-band characteristics and similar sample timing precision.

What is smple audio visualization library?

Smple audio visualization library which is especially useful for developers to visually check audio samples, e.g. by waveform or spectrum. (So far) this library is not capable of doing nice visualizations for end users. ***** WereSoCool !Now In Stereo! ****** Make cool sounds. Impress your friends.

Is the resampler asynchronous or synchronous?

The resampler class of this library was designed as an asynchronous processor: it may produce any number of output samples, depending on the input sample data length and the resampling parameters.

Is there a free alternative to resample in C++?

The free Open Source Audio Library Project (OSALP)(LGPL) contains a C++ class based on resample. The Speexspeech coder/decoder (based on CELP) contains a variation of the resamplealgorithm in the file resample.c, is free and open-source, and is released under a BSD-style license (i.e., free for both commercial and noncommercial uses).


2 Answers

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 and sndfile-resample (from libsamplerate) (in the Planet CCRMA Distribution).
  • libsoxr, the SoX resampler library
  • ssrc (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.
like image 154
mikerobi Avatar answered Sep 20 '22 20:09

mikerobi


Here's a code example using FFMpeg (avcodec) directly from C:

http://tdistler.com/2010/07/22/audio-resampling-using-ffmpeg-avcodec

like image 36
jhakeem Avatar answered Sep 22 '22 20:09

jhakeem