Transformations.Audio
2.0.4.3
See the version list below for details.
dotnet add package Transformations.Audio --version 2.0.4.3
NuGet\Install-Package Transformations.Audio -Version 2.0.4.3
<PackageReference Include="Transformations.Audio" Version="2.0.4.3" />
<PackageVersion Include="Transformations.Audio" Version="2.0.4.3" />
<PackageReference Include="Transformations.Audio" />
paket add Transformations.Audio --version 2.0.4.3
#r "nuget: Transformations.Audio, 2.0.4.3"
#:package Transformations.Audio@2.0.4.3
#addin nuget:?package=Transformations.Audio&version=2.0.4.3
#tool nuget:?package=Transformations.Audio&version=2.0.4.3
Transformations.Audio
Sample-rate conversion for .NET, with a repeatable, versioned fidelity benchmark behind every algorithm choice.
๐ Overview
Transformations.Audio resamples interleaved PCM audio (float[]) between arbitrary sample rates - the everyday "convert this 48 kHz recording to 44.1 kHz" or "upsample this 16 kHz voice clip to 48 kHz" problem. It ships several interchangeable algorithms behind one interface, from a cheap linear interpolator to alias-suppressing windowed-sinc variants, so you can pick the right speed/fidelity tradeoff for your use case.
Every algorithm in this package is backed by a deterministic fidelity suite that measures SNR, PSNR, and MSE across speech, music, transient, and alias-stress test signals - see DEVELOPMENT.md for the full evidence trail behind each one, including why some candidates were promoted and others retired.
๐ฆ Install
<PackageReference Include="Transformations.Audio" Version="2.0.4.3" />
Depends only on NAudio (for WaveFormat interop). Targets .NET 8, 9, and 10.
๐ Quick start
using Transformations.Audio.Resampler;
float[] input = GetSamples(); // interleaved PCM, e.g. from a WAV file
float[] output = Sinc.Resample(input, inRate: 48000, outRate: 44100, channels: 2);
Or resolve rates/channels from NAudio.Wave.WaveFormat directly:
float[] output = Sinc.Resample(input, inFormat, outFormat);
Extension-method form, including Span<float>/Memory<float> overloads:
using Transformations.Audio.Resampler;
float[] output = input.ResampleLinear(48000, 44100, channels: 2);
๐๏ธ Choosing an algorithm
| Class | What it is | Use it when |
|---|---|---|
Linear |
Straight-line interpolation between samples | You need the cheapest possible conversion and don't care about aliasing (e.g. quick previews) |
Spline |
Natural cubic spline (C2-continuous, global per-channel fit) | Better fidelity than Linear at a modest cost, no anti-alias filtering |
Sinc |
Windowed-sinc convolution, adjustable quality via ResampleQuality |
Highest raw fidelity when the signal has no energy near the new Nyquist (e.g. upsampling) |
Hybrid |
Picks Sinc or Linear based on sample rate |
A reasonable one-size default when you don't want to choose |
Sinc.Resample takes an optional ResampleQuality (SuperFast through BestQuality) trading kernel width for speed. Plain Sinc has no anti-alias rolloff, so it can lose fidelity on aggressive downsampling of high-energy content - see DEVELOPMENT.md for alias-suppressing variants and the evidence behind when to reach for one.
๐งช Evidence, not vibes
Every algorithm swap in this package's history was decided by a repeatable fidelity suite, not by ear. If you want to see the actual numbers, reproduce them, or understand why a given default was chosen, DEVELOPMENT.md has the full build/test instructions and the evidence trail.
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net8.0 is compatible. 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 is compatible. 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 is compatible. 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. |
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.