Gondwana.Audio.Browser 2.6.1

dotnet add package Gondwana.Audio.Browser --version 2.6.1
                    
NuGet\Install-Package Gondwana.Audio.Browser -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.Browser" 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.Browser" Version="2.6.1" />
                    
Directory.Packages.props
<PackageReference Include="Gondwana.Audio.Browser" />
                    
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.Browser --version 2.6.1
                    
#r "nuget: Gondwana.Audio.Browser, 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.Browser@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.Browser&version=2.6.1
                    
Install as a Cake Addin
#tool nuget:?package=Gondwana.Audio.Browser&version=2.6.1
                    
Install as a Cake Tool

Gondwana.Audio.Browser

Gondwana.Audio.Browser provides the browser/WASM implementation of Gondwana's backend-neutral Gondwana.Audio contracts.

The package uses .NET JavaScript interop plus HTML media and Web Audio APIs. New code can use the same Engine.Managers.AudioResources / AudioResource surface used by desktop audio.

Features

  • Browser-supported media formats such as MP3, WAV, and OGG
  • play, pause, resume, stop, seek, and looping
  • volume control
  • stereo pan through the Web Audio API when StereoPannerNode is available
  • playback speed from 0.25x through 4.0x
  • current position, duration, and common playback state
  • URI-based loading through AudioResourceManager.LoadFromUri
  • compatibility BrowserAudioManager / BrowserAudioPlayer wrappers for existing code
  • ships gondwana-audio.js as NuGet content

Installation

dotnet add package Gondwana.Audio.Browser

Setup

Import the JavaScript module before using browser audio:

var audioModuleUrl = new Uri(
    new Uri(builder.HostEnvironment.BaseAddress),
    "gondwana-audio.js").AbsoluteUri;

await JSHost.ImportAsync("gondwana-audio", audioModuleUrl);

Do not pass "./gondwana-audio.js" directly: JSHost.ImportAsync resolves that relative to Blazor's _framework/ module location rather than the application's base href. Building the absolute URL from HostEnvironment.BaseAddress works for both root and sub-path deployments.

Then configure the backend:

Engine.Instance.UseBrowserAudio();

Load and control audio through the common API:

var music = Engine.Managers.AudioResources.LoadFromUri(
    "music",
    "assets/theme.mp3",
    volume: 0.5f);

music.IsLooping = true;
music.Pan = 0.0f;
music.PlaybackSpeed = 1.0f;
music.Play();

The Gondwana Blazor template imports the JavaScript module for you.

Compatibility API

Existing code can continue to use:

var audio = Engine.Instance.GetBrowserAudioManager();
var music = audio.Load("music", "assets/theme.mp3", volume: 0.5f, loop: true);

BrowserAudioManager and BrowserAudioPlayer now act as compatibility façades over the common core audio model.

Browser-specific behavior

Browser audio supports both URI-addressable assets and raw byte/stream sources. Byte-backed resources, including audio entries from a streamed or file-backed AssetsFile, are exposed to the browser through temporary Blob URLs that are revoked when the resource is unloaded.

Autoplay remains subject to browser policy. When a requested play is rejected because the page has not received a user gesture yet, the browser backend keeps that request pending and retries it from the first subsequent pointer or touch gesture. Calling pause, stop, or unload before that gesture cancels the pending retry.

The JavaScript bridge forwards the HTML media ended event into .NET, changes playback state to Stopped, and raises AudioResource.PlaybackCompleted and PlaybackCompletedAsync for non-looping playback. Explicit stop and unload do not raise completion.

Pan uses Web Audio's StereoPannerNode when available. Cross-origin media must permit anonymous CORS access. Duration is zero until browser metadata is available; seeking and codec support follow browser capabilities.

All tracks share one lazily created AudioContext for the module's lifetime. Unloading a track disconnects its source/panner nodes without closing the shared context or interrupting other tracks. The context is retained until page teardown.

The original four-argument BrowserAudioManager.Load CLR overload is retained for compiled clients. New source callers can also supply pan and playback speed.

Actual codec support is determined by the host browser and operating system.

  • Gondwana — core engine and backend-neutral audio contracts
  • Gondwana.Audio.NAudio — Windows desktop audio backend
  • Gondwana.Blazor — browser rendering and input support
  • Gondwana.Blazor.Hosting — browser game hosting

Documentation

License

MIT

Product Compatible and additional computed target framework versions.
.NET net8.0-browser1.0 is compatible.  net9.0-browser was computed.  net10.0-browser was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
2.6.1 572 10/8/2026
2.6.0 1,094 9/17/2026
2.5.2 775 7/26/2026
2.5.1 179 7/19/2026
2.5.0 180 7/9/2026
2.4.3 249 6/16/2026
2.4.2 218 6/11/2026
2.4.1 152 6/9/2026
2.3.0 304 5/19/2026
2.2.4 302 5/9/2026
2.2.3 220 5/5/2026