---
title: "oneaudio cookbook"
url: https://recursiveai.org/oneaudio/cookbook/
description: "Short recipes for common oneaudio tasks, each a complete program that was run against version 1.2.1, the device recipes with RecursiveAI.OneAudio.Devices…"
version: "1.2.1"
---

# oneaudio cookbook

Short recipes for common oneaudio tasks, each a complete program that was run against version 1.2.1, the device recipes with RecursiveAI.OneAudio.Devices 1.2.1.

## Recipes

- [Decode MP3 in C#](https://recursiveai.org/oneaudio/cookbook/decode-mp3/index.md): Decode MP3 files to float samples or WAV in C# with oneaudio, a managed decoder with no native code: gapless trimming, exact seeking, and MP3 bytes held…
- [Decode Ogg Vorbis in C#](https://recursiveai.org/oneaudio/cookbook/decode-ogg-vorbis/index.md): Decode Ogg Vorbis files in C# with oneaudio: load or stream the samples, read the comment tags, and play chained Ogg files as one stream.
- [Decode Opus in C#](https://recursiveai.org/oneaudio/cookbook/decode-opus/index.md): Decode Ogg Opus files in C# with oneaudio, convert them to your app’s sample rate, and decode raw Opus packets from a voice or network stream, with…
- [Decode audio from a stream](https://recursiveai.org/oneaudio/cookbook/streaming-decode/index.md): Decode audio in C# from a stream that can’t seek, such as a network response or a pipe, block by block with flat memory, with limits and typed errors for…
- [Read audio metadata](https://recursiveai.org/oneaudio/cookbook/read-audio-metadata/index.md): Read the sample rate, channels, bit depth, duration and tags of WAV, MP3, Ogg Vorbis, Opus and FLAC files in C# with oneaudio, without decoding the audio.
- [Read and write FLAC in C#](https://recursiveai.org/oneaudio/cookbook/flac/index.md): Decode FLAC files bit-exact in C# with oneaudio, verify the MD5 signature, read the tags, and encode WAV to FLAC at compression levels 0 to 8 with your…
- [Read and write WAV files in C#](https://recursiveai.org/oneaudio/cookbook/wav/index.md): Read WAV and RF64 files in C# with oneaudio as exact integers or floats, and write 16-bit, 24-bit or 32-bit float WAV, with dither when you reduce the bit…
- [Encode Opus in C#](https://recursiveai.org/oneaudio/cookbook/encode-opus/index.md): Encode WAV, FLAC or MP3 to Ogg Opus in C# with oneaudio, a managed Opus encoder: choose the bitrate and mode, add tags, and encode speech with the VoIP…
- [Convert audio files](https://recursiveai.org/oneaudio/cookbook/convert-audio-files/index.md): Convert MP3, Ogg Vorbis, Opus, FLAC and WAV files to WAV, FLAC or Ogg Opus in C# with oneaudio, change the sample rate and channels on the way, and…
- [Resample audio in C#](https://recursiveai.org/oneaudio/cookbook/resample-audio/index.md): Resample audio in C# with oneaudio, from 44.1 kHz to 48 kHz and back or any ratio up to 64, in one call or as a stream, with three quality levels and no…
- [Mix audio files](https://recursiveai.org/oneaudio/cookbook/mix-audio/index.md): Mix music, voice and sound effects in C# with oneaudio’s real-time mixer: buses, ducking, reverb, pitch, a limiter and loudness meters, rendered to a WAV…
- [Measure loudness (LUFS, true peak, LRA)](https://recursiveai.org/oneaudio/cookbook/measure-loudness/index.md): Measure integrated loudness in LUFS, loudness range and true peak in C# with oneaudio’s ITU-R BS.1770-5 and EBU R 128 meter, for a whole file or live…
- [Normalize loudness to −14 or −23 LUFS](https://recursiveai.org/oneaudio/cookbook/normalize-loudness/index.md): Normalize audio loudness in C# with oneaudio: write a copy at −14 LUFS, or −23 LUFS for EBU R 128 broadcast, with a true-peak ceiling, or scale samples in…
- [Keep only the codecs you use](https://recursiveai.org/oneaudio/cookbook/trim-codecs/index.md): Make small NativeAOT and trimmed .NET apps with oneaudio: register only the formats you read with an AudioKit, so the other decoders are trimmed away.
- [Play an audio file](https://recursiveai.org/oneaudio/cookbook/play-audio-file/index.md): Play a WAV, MP3, Ogg or FLAC file on the default sound card in C#, with oneaudio’s mixer and the RecursiveAI.OneAudio.Devices package, and check from the…
- [Record from the microphone](https://recursiveai.org/oneaudio/cookbook/record-microphone/index.md): Record audio from the default microphone in C# and save it as a 16-bit WAV file, with the RecursiveAI.OneAudio.Devices package and oneaudio’s WAV encoder.
- [List audio devices](https://recursiveai.org/oneaudio/cookbook/list-audio-devices/index.md): List the playback and recording devices in C#, find the system defaults, and open a particular device by its id, with the RecursiveAI.OneAudio.Devices…
