Gondwana Game Engine Development (master) - 2.6.1
Gondwana is a cross-platform 2.5D game and rendering engine written in C#/.NET 8. It provides fine-grained control over rendering, timing, and scene composition, with built-in support for parallax, z-ordering, pixel overhang, collision detection, and particle effects. Gondwana targets desktop and web platforms using SkiaSharp for graphics and pluggable audio backends for desktop and browser targets.
Loading...
Searching...
No Matches
Gondwana.Audio.Browser.BrowserAudioBackend Class Referencesealed

Browser/WASM audio backend implemented with HTML media and Web Audio APIs. More...

Inheritance diagram for Gondwana.Audio.Browser.BrowserAudioBackend:
Gondwana.Audio.IAudioBackend

Public Member Functions

IAudioPlaybackHandle CreateFromBytes (string key, byte[] data, string fileNameOrExtension, float volume, float pan, float playbackSpeed)
 Creates a playback handle from raw audio bytes. The implementation is responsible for interpreting the provided data according to the file hint.
Parameters
keyA unique key for the audio resource.
dataRaw audio data bytes.
fileNameOrExtensionA file name or extension used as a hint for format detection (for example ".wav").
volumeInitial volume (0.0 to 1.0).
panInitial stereo pan (-1.0 to 1.0).
playbackSpeedInitial playback speed.
Returns
An IAudioPlaybackHandle representing the created playback instance.

IAudioPlaybackHandle CreateFromUri (string key, string uri, float volume, float pan, float playbackSpeed)
 Creates a playback handle that plays audio from the specified URI. This is intended for backends that can stream or reference remote/local URIs directly (for example browser audio backends).
Parameters
keyA unique key for the audio resource.
uriThe URI that identifies the audio resource.
volumeInitial volume (0.0 to 1.0).
panInitial stereo pan (-1.0 to 1.0).
playbackSpeedInitial playback speed.
Returns
An IAudioPlaybackHandle representing the created playback instance.

Properties

static BrowserAudioBackend Instance = new() [get]
 Gets the shared instance.
string Name [get]
 Gets the human-readable name of the backend implementation.

Detailed Description

Browser/WASM audio backend implemented with HTML media and Web Audio APIs.

Definition at line 7 of file BrowserAudioBackend.cs.

Member Function Documentation

◆ CreateFromBytes()

IAudioPlaybackHandle Gondwana.Audio.Browser.BrowserAudioBackend.CreateFromBytes ( string key,
byte[] data,
string fileNameOrExtension,
float volume,
float pan,
float playbackSpeed )

Creates a playback handle from raw audio bytes. The implementation is responsible for interpreting the provided data according to the file hint.

Parameters
keyA unique key for the audio resource.
dataRaw audio data bytes.
fileNameOrExtensionA file name or extension used as a hint for format detection (for example ".wav").
volumeInitial volume (0.0 to 1.0).
panInitial stereo pan (-1.0 to 1.0).
playbackSpeedInitial playback speed.
Returns
An IAudioPlaybackHandle representing the created playback instance.

Implements Gondwana.Audio.IAudioBackend.

Definition at line 20 of file BrowserAudioBackend.cs.

◆ CreateFromUri()

IAudioPlaybackHandle Gondwana.Audio.Browser.BrowserAudioBackend.CreateFromUri ( string key,
string uri,
float volume,
float pan,
float playbackSpeed )

Creates a playback handle that plays audio from the specified URI. This is intended for backends that can stream or reference remote/local URIs directly (for example browser audio backends).

Parameters
keyA unique key for the audio resource.
uriThe URI that identifies the audio resource.
volumeInitial volume (0.0 to 1.0).
panInitial stereo pan (-1.0 to 1.0).
playbackSpeedInitial playback speed.
Returns
An IAudioPlaybackHandle representing the created playback instance.

Implements Gondwana.Audio.IAudioBackend.

Property Documentation

◆ Instance

BrowserAudioBackend Gondwana.Audio.Browser.BrowserAudioBackend.Instance = new()
staticget

Gets the shared instance.

Definition at line 14 of file BrowserAudioBackend.cs.

◆ Name

string Gondwana.Audio.Browser.BrowserAudioBackend.Name
get

Gets the human-readable name of the backend implementation.

Implements Gondwana.Audio.IAudioBackend.

Definition at line 17 of file BrowserAudioBackend.cs.