MCPcopy Index your code
hub / github.com/dh1tw/gosamplerate

github.com/dh1tw/gosamplerate @v0.1.2

Chat with this repo
repository ↗ · DeepWiki ↗ · release v0.1.2 ↗ · + Follow
33 symbols 105 edges 2 files 14 documented · 42%
What it actually does AI analysis from the code graph — generated when you open this
loading…
README

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:

License

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.

Linux:

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

    $ sudo apt install libsamplerate0

MacOS

using Homebrew:

    $ brew install libsamplerate

Install gosamplerate

    $ go get github.com/dh1tw/gosamplerate

Documentation

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.

Core symbols most depended-on inside this repo

New
called by 10
gosamplerate.go
Error
called by 5
gosamplerate.go
Delete
called by 4
gosamplerate.go
Process
called by 4
gosamplerate.go
Simple
called by 3
gosamplerate.go
IsValidRatio
called by 3
gosamplerate.go
GetChannels
called by 2
gosamplerate.go
SetRatio
called by 2
gosamplerate.go

Shape

Function 27
Method 5
Struct 1

Languages

Go100%

Modules by API surface

gosamplerate_test.go19 symbols
gosamplerate.go14 symbols

For agents

$ claude mcp add gosamplerate \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact