LibSampleRate 1.1.0
dotnet add package LibSampleRate --version 1.1.0
NuGet\Install-Package LibSampleRate -Version 1.1.0
<PackageReference Include="LibSampleRate" Version="1.1.0" />
<PackageVersion Include="LibSampleRate" Version="1.1.0" />
<PackageReference Include="LibSampleRate" />
paket add LibSampleRate --version 1.1.0
#r "nuget: LibSampleRate, 1.1.0"
#:package LibSampleRate@1.1.0
#addin nuget:?package=LibSampleRate&version=1.1.0
#tool nuget:?package=LibSampleRate&version=1.1.0
LibSampleRate.NET
A managed wrapper for the popular libsamplerate (aka Secret Rabbit Code) resampling library, written in C#.
Platform Support
The library currently supports Windows x86 and x64. Other platforms can be easily added, but are currently not included because the upstream repository only provides Windows builds.
Usage
The easiest way to use this library is by installing the package through NuGet.
The entire public API surface lives in and is documented in SampleRateConverter.cs. A minimal example:
using System;
using LibSampleRate;
var channels = 1;
var ratio = 2.0;
var inputBuffer = new float[1000];
var outputBuffer = new float[2000];
var src = new SampleRateConverter(ConverterType.SRC_SINC_BEST_QUALITY, channels);
src.SetRatio(ratio);
src.Process(
inputBuffer,
0,
inputBuffer.Length,
outputBuffer,
0,
outputBuffer.Length,
endOfInput: true,
out var inputSampleCount,
out var outputSampleCount
);
Console.WriteLine($"{inputSampleCount} input samples resampled to {outputSampleCount} output samples.");
See the LibSampleRate.Demo project for a more complete streaming scenario that shows how to push blocks of audio through the converter.
Development
The solution contains two projects: the managed wrapper library, and a small console app demonstrating streaming resampling and serving as an integration test.
Run the helper script before building with Visual Studio or dotnet build so the native DLLs and their notices are available:
pwsh scripts/fetch-libsamplerate.ps1
License & Credits
Copyright (C) 2011-2025 Mario Guggenberger mg@protyposis.net. Released under the BSD 2-Clause license.
This project builds upon libsamplerate, Copyright (c) 2012-2016, Erik de Castro Lopo erikd@mega-nerd.com. Released under the BSD 2-Clause license.
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net5.0 was computed. net5.0-windows was computed. net6.0 was computed. net6.0-android was computed. net6.0-ios was computed. net6.0-maccatalyst was computed. net6.0-macos was computed. net6.0-tvos was computed. net6.0-windows was computed. net7.0 was computed. net7.0-android was computed. net7.0-ios was computed. net7.0-maccatalyst was computed. net7.0-macos was computed. net7.0-tvos was computed. net7.0-windows was computed. net8.0 was computed. net8.0-android was computed. net8.0-browser was computed. net8.0-ios was computed. net8.0-maccatalyst was computed. net8.0-macos was computed. net8.0-tvos was computed. net8.0-windows was computed. net9.0 was computed. net9.0-android was computed. net9.0-browser was computed. net9.0-ios was computed. net9.0-maccatalyst was computed. net9.0-macos was computed. net9.0-tvos was computed. net9.0-windows was computed. net10.0 was computed. net10.0-android was computed. net10.0-browser was computed. net10.0-ios was computed. net10.0-maccatalyst was computed. net10.0-macos was computed. net10.0-tvos was computed. net10.0-windows was computed. |
| .NET Core | netcoreapp2.0 was computed. netcoreapp2.1 was computed. netcoreapp2.2 was computed. netcoreapp3.0 was computed. netcoreapp3.1 was computed. |
| .NET Standard | netstandard2.0 is compatible. netstandard2.1 was computed. |
| .NET Framework | net461 was computed. net462 was computed. net463 was computed. net47 was computed. net471 was computed. net472 was computed. net48 was computed. net481 was computed. |
| MonoAndroid | monoandroid was computed. |
| MonoMac | monomac was computed. |
| MonoTouch | monotouch was computed. |
| Tizen | tizen40 was computed. tizen60 was computed. |
| Xamarin.iOS | xamarinios was computed. |
| Xamarin.Mac | xamarinmac was computed. |
| Xamarin.TVOS | xamarintvos was computed. |
| Xamarin.WatchOS | xamarinwatchos was computed. |
-
.NETStandard 2.0
- No dependencies.
NuGet packages (1)
Showing the top 1 NuGet packages that depend on LibSampleRate:
| Package | Downloads |
|---|---|
|
Aurio.LibSampleRate
Extension library for Aurio, which provides audio resampling through the external libsamplerate/SecretRabbitCode library (see https://github.com/libsndfile/libsamplerate). |
GitHub repositories
This package is not used by any popular GitHub repositories.
| Version | Downloads | Last Updated |
|---|---|---|
| 1.1.0 | 264 | 11/16/2025 |