NAudio.Vorbis 3.0.0

Prefix Reserved
dotnet add package NAudio.Vorbis --version 3.0.0
                    
NuGet\Install-Package NAudio.Vorbis -Version 3.0.0
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="NAudio.Vorbis" Version="3.0.0" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="NAudio.Vorbis" Version="3.0.0" />
                    
Directory.Packages.props
<PackageReference Include="NAudio.Vorbis" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add NAudio.Vorbis --version 3.0.0
                    
#r "nuget: NAudio.Vorbis, 3.0.0"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package NAudio.Vorbis@3.0.0
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=NAudio.Vorbis&version=3.0.0
                    
Install as a Cake Addin
#tool nuget:?package=NAudio.Vorbis&version=3.0.0
                    
Install as a Cake Tool

NAudio.Vorbis

build NuGet

NAudio.Vorbis is a convenience wrapper that lets you play and read Ogg Vorbis files with NAudio, using NVorbis to do the decoding.

Requirements

NAudio.Vorbis Requires
3.x NAudio 3, .NET 9
1.5.0 NAudio 2, .NET Standard 2.0

NAudio 3 dropped .NET Framework and .NET Standard 2.0 and changed the Read signatures on IWaveProvider and ISampleProvider to take a Span<T>, so NAudio.Vorbis 3.0 is a clean break. If you are still on NAudio 2, stay on NAudio.Vorbis 1.5.0.

Playing a file

VorbisWaveReader is a WaveStream, so it plugs into any NAudio output device:

using NAudio.Vorbis;
using NAudio.Wave;

using var reader = new VorbisWaveReader("path/to/file.ogg");
using var player = new WasapiPlayerBuilder().Build();

player.Init(reader);
player.Play();

// wait here until playback stops or should stop

WasapiPlayer comes from the NAudio.Wasapi package. Any other NAudio output works the same way — WaveOut from NAudio.WinMM, or AlsaOut from NAudio.Alsa on Linux.

Reading samples

VorbisWaveReader also implements ISampleProvider, so it drops straight into a sample pipeline:

using NAudio.Wave.SampleProviders;

using var reader = new VorbisWaveReader("path/to/file.ogg");
var mixer = new MixingSampleProvider(new[] { (ISampleProvider)reader });

Or convert to a WAV file:

using var reader = new VorbisWaveReader("path/to/file.ogg");
WaveFileWriter.CreateWaveFile("output.wav", reader);

VorbisSampleProvider is the layer underneath, and exposes the things VorbisWaveReader deliberately hides — the end-of-stream event, and switching between the logical streams of a chained file.

Seeking

VorbisWaveReader supports seeking when the underlying stream does. Positions are in bytes and should be a multiple of WaveFormat.BlockAlign:

reader.CurrentTime = TimeSpan.FromSeconds(30);

A source that cannot seek (a network or pipe stream) still decodes; only Position and Length are unavailable.

Known NVorbis limitations

Decoding is NVorbis's job, and the current stable release (0.10.5) has bugs we cannot work around from here. All three are fixed in the NVorbis 1.0.0 line, which is still a prerelease — a stable package should not depend on one, so releases stay on 0.10.5 until NVorbis 1.0 ships.

  • Seeking into the final page can throw InvalidDataException: GranulePos mismatch when the last page's granule position does not line up with the packets on it — the ordinary shape of an encoder's trailing partial page (NVorbis#39)
  • Seeking back to the start does not always land on the first sample. The position reads back as 0, but decoding can resume elsewhere in the file
  • A forward-only source can still hang on a file whose granule positions understate its contents. For seekable sources this is handled — reads are clamped to what the stream has left — but with no length to clamp to there is nothing to be done here (NVorbis#40, #16)

To try a build against the NVorbis 1.0 prerelease:

dotnet build -p:NVorbisVersion=1.0.0-rc.2

The release workflow takes the same value, so preview packages on the NVorbis 1.0 prerelease can be published without changing the repo default.

Strong naming

The assembly is strong-named from 3.0 onwards, as NAudio and NLayer are; 1.5.0 and earlier were not, so the assembly identity changes with this release. The key is checked in at the repo root: for open-source strong naming the private half is not a secret — it establishes assembly identity, it does not protect anything — and a key nobody can build with would be worse than none.

NVorbis is not strong-named, in any version, so the build suppresses CS8002 for that reference. .NET Framework refused to load an unsigned reference from a signed assembly, but .NET Core and later dropped strong-name verification, so on net9.0 it has no effect.

Building

dotnet build NAudio.Vorbis.slnx
dotnet test NAudio.Vorbis.slnx

The solution is in the XML .slnx format, so it needs the .NET 9.0.200 SDK or later; global.json pins that floor and rolls forward to newer SDKs.

TestApp is a WinForms harness (Windows only) for playing a file by hand and dragging a position bar around, which is the most practical way to exercise seeking. It reports failed seeks in its status line rather than crashing, so you can see which files misbehave.

The test corpus in NAudio.Vorbis.Tests/TestFiles is generated from synthesised tones rather than taken from any recording; NAudio.Vorbis.Tests/tools has the script that regenerates it.

Releasing

build.yml builds and tests every push and pull request, and separately builds against the NVorbis 1.0 prerelease. release.yml publishes to NuGet:

  • Final release — set VersionPrefix in Directory.Build.props, rename the ### Unreleased section of RELEASE_NOTES.md to ### <version> (date), then push a matching v* tag. The workflow refuses to cut a final release against a prerelease NVorbis
  • Preview — run the workflow manually from master. It publishes <VersionPrefix>-preview.<run number>, or the label you pass in milestone. Pass nvorbis_version to build the preview against a different NVorbis

After a final release, bump VersionPrefix to the next development version. Without that, the next preview is numbered below the release that just shipped, since 3.0.0-preview.N sorts before 3.0.0.

Publishing uses NuGet trusted publishing (OIDC), so there is no API key to rotate; the NUGET_USER repository variable names the NuGet.org account.

Licence

MIT.

Product Compatible and additional computed target framework versions.
.NET 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 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. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages (21)

Showing the top 5 NuGet packages that depend on NAudio.Vorbis:

Package Downloads
Evergine.Assets

Provides utilities to work with different assets formats (e.g. audio formats, textures, 3D models...)

Milki.Extensions.MixPlayer

This library is for timelined sound effects playing.

MappingTools.Core

osu! mapping utility library built for Mapping Tools.

WaveEngine.Assets

Provides utilities to work with different assets formats (e.g. audio formats, textures, 3D models...)

SimulationFramework.Desktop

The desktop environment for SimulationFramework.

GitHub repositories (36)

Showing the top 20 popular GitHub repositories that depend on NAudio.Vorbis:

Repository Stars
AssetRipper/AssetRipper
GUI application to analyze game files
openutau/OpenUtau
Open singing synthesis platform / Open source UTAU successor
UnderminersTeam/UndertaleModTool
The most complete tool for modding, decompiling and unpacking Undertale (and other GameMaker games!)
Valkirie/HandheldCompanion
A touch optimized GUI to increase your handheld gaming computer experience.
WolvenKit/WolvenKit
Community Mod editor/creator for REDengine games.
MaKiPL/OpenVIII-monogame
Open source Final Fantasy VIII engine implementation in C# working on Windows and Linux (Android and iOS planned too!) [Monogame]
overtools/OWLib
DataTool is a program that lets you extract models, maps, and files from Overwatch.
Meowmaritus/DSAnimStudio
Direct3D-Accelerated Dark Souls TAE Editor
vchelaru/FlatRedBall
Cross-platform 2D game engine focused on ultimate productivity built in .NET
ciribob/DCS-SimpleRadioStandalone
An open source Stand alone Radio for DCS integrating with all clickable cockpits and FC3 Aircraft
h4lfheart/FortnitePorting
The quickest and most efficient way to extract assets from Fortnite
Suprcode/Zircon
Legend of Mir 3 - Official Public Zircon Source
rampaa/JL
JL is a program for looking up Japanese words and expressions.
leezer3/OpenBVE
OpenBVE- A free train simulator
Piotrekol/CollectionManager
An extensive tool for creating, editing, and exporting of osu! collections.
vocoder712/OpenUtauMobile
OpenUtau Mobile 是一个面向移动端的开源免费歌声合成软件; OpenUtau Mobile is a free and open-source singing voice synthesis software for mobile devices.
Kalejin/DCSB
Deathcounter and Soundboard, WPF app for setting up key shortcuts
mir-ethernity/mir-eternal
shinyflvre/VRCNext
VRCN is a VRChat launcher for Windows that includes various useful tools within a clean interface. It allows you to manage friends, groups, and more in a single application without needing to visit VRChat.com.
kuma4649/MDPlayer
Version Downloads Last Updated
3.0.0 885 9/7/2026
3.0.0-preview.1 66 9/4/2026
1.5.0 535,443 9/29/2021

NAudio.Vorbis 3.0 requires NAudio 3 and .NET 9. If you are still on NAudio 2 or
need .NET Standard 2.0, stay on NAudio.Vorbis 1.5.0.

* **Breaking:** the minimum target framework is now `net9.0`; .NET Standard 2.0 is dropped, following NAudio 3
* **Breaking:** `Read` follows NAudio 3's `Span<T>` signatures. `VorbisSampleProvider` implements `ISampleProvider.Read(Span<float>)` and `VorbisWaveReader` implements `Read(Span<byte>)`; the `(buffer, offset, count)` overloads remain as forwarders, so existing calling code still compiles. Without this, loading the assembly against NAudio 3 threw `TypeLoadException: Method 'Read' in type 'NAudio.Vorbis.VorbisWaveReader' does not have an implementation` (#20)
* **Breaking:** removed the long-obsolete `IsParameterChange`, `ClearParameterChange` and `ContainerOverheadBits` members
* **Breaking:** the assembly is now strong-named, matching NAudio and NLayer. Earlier versions were unsigned, so the assembly identity changes
* Fixed a hang decoding files whose stated length understates their contents. A read that runs past the end can leave NVorbis's decode state with a negative valid length, after which its `Read` loop spins forever - `Stream.CopyTo` always over-reads on its final call, which is how this was hit. Reads are now clamped to what the stream has left (#16)
* Updated to NVorbis 0.10.5, which fixes `VorbisWaveReader.Comments` throwing an `InvalidCastException` on every file (#17)
* `VorbisWaveReader` reads decoded audio straight into the caller's buffer, removing a `[ThreadStatic]` scratch buffer and a copy per read
* The public API is now fully XML-documented, so the package ships complete IntelliSense
* The package now carries the repo README, so the NuGet page documents how to get started (#18)
* Added a unit test suite, a WinForms test harness, and build and release pipelines

Seeking still has limitations that come from the current stable NVorbis rather
than from this wrapper - seeking into the final page of a file can throw, and
seeking back to the start does not always land on the first sample. Both are
fixed in the NVorbis 1.0.0 line, which is still a prerelease. See
[Known NVorbis limitations](https://github.com/naudio/Vorbis#known-nvorbis-limitations).