Go Bindings for libsamplerate
Clone or download
dh1tw Merge pull request #1 from dominikh/master
don't truncate returned samples in Simple
Latest commit b4c0190 Jun 4, 2018
Type Name Latest commit message Commit time
Failed to load latest commit information.
.travis.yml added go 1.8 Feb 24, 2017
gosamplerate.go don't truncate returned samples in Simple Jun 1, 2018
test added link to libsamplerate documentation Dec 26, 2016


libsamplerate binding for Golang

Go Report Card Build Status Coverage Status

This is a Golang binding for libsamplerate (written in C), probably the best audio Sample Rate Converter available to today.

A classical use case is converting audio from a CD sample rate of 44.1kHz to the 48kHz sample rate used by DAT players.

libsamplerate is capable of arbitrary and time varying conversions (max sampling / upsampling by factor 256) and comes with 5 converters, allowing quality to be traded off against computation cost.

API implementations

gosamplerate implements the following libsamplerate API calls:

not (yet) implemented is:


This library (gosamplerate) is published under the the permissive BSD license. You can find a good comparison of Open Source Software licenses, including the BSD license at choosealicense.com

libsamplerate has been republished in 2016 under the 2-clause BSD license.

How to install samplerate

Make sure that you have libsamplerate installed on your system.

On Mac or Linux it can be installed conveniently through your distro's packet manager.


using apt (Ubuntu), yum (Centos)...etc.

    $ sudo apt install libsamplerate0


using Homebrew:

    $ brew install libsamplerate

Install gosamplerate

    $ go get github.com/dh1tw/gosamplerate


The API of gosamplerate can be found at godoc.org. The documentation of libsamplerate (necessary in order to fully understand the API) can be found here.

Tests & Examples

The test coverage is close to 100%. The tests contain various examples on how to use gosamplerate.