Convert the samplerate of PCM audio data using libsamplerate (AKA "Secret Rabbit Code".)
Latest commit 79b7cba Apr 23, 2017 @jonathanstowe Fix licence


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 panda :

# From the source directory

panda install .

# Remote installation

panda 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