Recursive AI
LibraryC#Available

oneaudio

Audio decode, encode, resample, mix and analyze for .NET, written from the specifications with no dependency beyond .NET itself. Built first for game audio.

dotnet add package RecursiveAI.OneAudio

A quick look

One call per job: load, play, stream, transcode, measure and normalize. Every default is tunable through an options record.

Read the API
Program.csC#
using OneAudio;
 
var clip = Audio.Load("hit.wav");
var mixer = Audio.CreateMixer();
mixer.Play("hit.wav", new PlayOptions { Gain = 0.8f, Pan = -0.3f });
using var music = mixer.PlayStream("music.ogg", loop: true);
 
Audio.Transcode("take.wav", "take.flac");
var loudness = Audio.Measure("take.flac");
Audio.Normalize("take.wav", "take-14.wav");
What it does

What it does

Six formats, streaming

Decodes WAV and RF64, Ogg, Vorbis, Opus, FLAC and MP3 into caller-provided spans, with sample-accurate seeking everywhere. Encodes WAV, FLAC and Opus.

A mixer for games

Voices, buses, ducking, pitch, pan, loops, fades and streaming sources, plus filters, a reverb and a limiter. The render callback allocates nothing and takes no locks.

Playback and recording

The RecursiveAI.OneAudio.Devices package plays a mixer and records from a microphone through WASAPI, Core Audio and ALSA. It follows the default device, reopens a lost one, and counts what the hardware really played.

Loudness

BS.1770-5 and EBU R 128: momentary, short-term, integrated, loudness range and true peak, at any sample rate. Normalize defaults to −14 LUFS with a −1 dBTP ceiling.

Checked against the references

All 12 Opus test vectors pass, the Opus encoder matches the RFC 6716 reference byte for byte on 269 of 269 configurations, and FLAC decodes bit-exact.

Performance

Faster than the managed decoders, with far less garbage

On every like-for-like file it decodes faster than NVorbis, Concentus, NLayer, PureFlac and NAudio.Flac, while allocating a fixed few hundred KB whatever the length. Measured with BenchmarkDotNet.

Every result and the method

The package

Go further