Gondwana.Audio.NAudio 2.6.1

dotnet add package Gondwana.Audio.NAudio --version 2.6.1
                    
NuGet\Install-Package Gondwana.Audio.NAudio -Version 2.6.1
                    
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="Gondwana.Audio.NAudio" Version="2.6.1" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Gondwana.Audio.NAudio" Version="2.6.1" />
                    
Directory.Packages.props
<PackageReference Include="Gondwana.Audio.NAudio" />
                    
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 Gondwana.Audio.NAudio --version 2.6.1
                    
#r "nuget: Gondwana.Audio.NAudio, 2.6.1"
                    
#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 Gondwana.Audio.NAudio@2.6.1
                    
#: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=Gondwana.Audio.NAudio&version=2.6.1
                    
Install as a Cake Addin
#tool nuget:?package=Gondwana.Audio.NAudio&version=2.6.1
                    
Install as a Cake Tool

Gondwana.Audio.NAudio

Stop() resets the reported position to zero. NAudio finishes stopping its worker asynchronously; the stream and speed-provider buffers are rewound after that worker exits, before any queued Play(false) begins. This avoids blocking a UI thread that may need to deliver the stop callback. An already-stopped source rewinds immediately.

Gondwana.Audio.NAudio provides the Windows desktop audio backend for the Gondwana Game Engine using NAudio.

The core Gondwana package defines the backend-neutral Gondwana.Audio contracts and resource APIs. This package supplies the NAudio implementation used by Windows desktop games.

Features

  • WAV and MP3 playback
  • OGG / OGA / MOGG playback through NAudio.Vorbis
  • WMA and M4A playback through Media Foundation
  • play, pause, resume, stop, seek, looping, volume, and stereo pan
  • variable playback speed from 0.25x through 4.0x
  • loading from files, streams, and Gondwana asset files
  • integration with Engine.Managers.AudioResources

Playback speed changes rate and pitch together. Pitch-preserving time stretching is not part of the core audio contract.

Setup

Install Gondwana.Audio.NAudio in a Windows-targeted project (net8.0-windows). A cross-platform net8.0 desktop project needs a compatible backend selected explicitly; adding this Windows package is not a cross-platform audio solution.

using Gondwana;

Engine.Instance.UseNAudio();

When using Gondwana.WinForms.Hosting, platform configuration initializes the NAudio backend automatically. Direct WinForms users may continue to call:

Engine.Instance.InitializeWinFormsAudioFormats();

which now configures this backend.

Playback

var sound = Engine.Managers.AudioResources.LoadFromFile("theme", "assets/theme.ogg");
sound.Volume = 0.8f;
sound.Pan = 0.0f;
sound.PlaybackSpeed = 1.25f;
sound.IsLooping = true;
sound.Play();
  • Gondwana — core engine and backend-neutral audio contracts
  • Gondwana.Audio.Browser — browser/WASM audio backend
  • Gondwana.Audio.Midi — MIDI/SoundFont support built on the NAudio pipeline
Product Compatible and additional computed target framework versions.
.NET net8.0-windows7.0 is compatible.  net9.0-windows 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 (2)

Showing the top 2 NuGet packages that depend on Gondwana.Audio.NAudio:

Package Downloads
Gondwana.WinForms

WinForms-based platform support for the Gondwana Game Engine, providing rendering, input, and Windows desktop integration.

Gondwana.Audio.Midi

MIDI audio playback support for the Gondwana Game Engine, including integration for loading and playing MIDI files through the NAudio audio backend.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
2.6.1 323 10/8/2026
2.6.0 1,109 9/17/2026