Convert the samplerate of PCM audio data using libsamplerate (AKA "Secret Rabbit Code".)
Clone or download
Latest commit ccc5687 Nov 4, 2017
Type Name Latest commit message Commit time
Failed to load latest commit information.
examples Add more fully featured example Aug 12, 2015
lib/Audio/Convert Up version Apr 26, 2016
t Skip test if no library Apr 26, 2016
.gitignore Add .precomp to .gitignore Dec 17, 2015
.travis.yml Alter travis config to use zef Aug 2, 2017
Changes Add changes Nov 4, 2017 Forgot these things Apr 26, 2016
LICENCE rename LICENCE as en_GB May 30, 2016
META6.json Fix licence Apr 22, 2017 No panda Aug 22, 2017


Convert the samplerate of PCM audio data using libsamplerate (AKA "Secret Rabbit Code".)

Build Status


This provides a mechanism for doing sample rate conversion of PCM audio data using libsamplerate ( the implementation of which is both fairly quick and accurate.

The interface is fairly simple, providing methods to work with native C arrays where the raw speed is important as well as perl arrays where further processing is required on the data.

The native library is designed to work only with 32 bit floating point samples so working with other sample types requires some conversion and a subsequent small loss of efficiency (although the int and short to float conversions are done in C code and so are reasonably quick.) There is no support for 64 bit int (long) or float (double) data.

The full documentation is available as POD or Markdown


You will need to have "libsamplerate" installed on your system in order to be able to use this. Most Linux distributions offer it as a package, though it is such a common dependency for multimedia applications that you may well already have it installed.

If you are on some platform that doesn't provide libsamplerate as a package then you may be able to install it from source:

I am however unlikely to be able to offer help with installing it this way.

Assuming you have a working perl6 installation you should be able to install this with zef :

# From the source directory

zef install .

# Remote installation

zef install Audio::Convert::Samplerate

Other install mechanisms may be become available in the future.


Suggestions/patches are welcomed via github at


Please see the LICENCE file in the distribution

© Jonathan Stowe 2015, 2016, 2017