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.NAudio.NAudioAudioBackend Class Referencesealed

Windows desktop audio backend implemented with NAudio. More...

Inheritance diagram for Gondwana.Audio.NAudio.NAudioAudioBackend:
Gondwana.Audio.IAudioBackend

Public Member Functions

IAudioPlaybackHandle CreateFromBytes (string key, byte[] data, string fileNameOrExtension, float volume, float pan, float playbackSpeed)
 Creates an IAudioPlaybackHandle from the provided raw audio bytes. The data is opened via the NAudioReaderRegistry which may create a temporary file. The returned playback handle is responsible for disposing the underlying reader when finished.
IAudioPlaybackHandle CreateFromUri (string key, string uri, float volume, float pan, float playbackSpeed)
 Creates an IAudioPlaybackHandle from a URI.

Properties

static NAudioAudioBackend Instance = new() [get]
 Gets the singleton instance of the NAudioAudioBackend.
string Name [get]
 Gets the display name of this audio backend.

Detailed Description

Windows desktop audio backend implemented with NAudio.

Definition at line 4 of file NAudioAudioBackend.cs.

Member Function Documentation

◆ CreateFromBytes()

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

Creates an IAudioPlaybackHandle from the provided raw audio bytes. The data is opened via the NAudioReaderRegistry which may create a temporary file. The returned playback handle is responsible for disposing the underlying reader when finished.

Parameters
keyLogical key for the audio resource (used for logging).
dataRaw audio data to load.
fileNameOrExtensionA hint containing the original file name or extension to aid format detection.
volumeInitial playback volume in the range [0,1].
panInitial stereo pan in the range [-1,1].
playbackSpeedInitial playback speed multiplier (clamped to supported range).
Returns
An IAudioPlaybackHandle instance that controls playback for the loaded audio resource.

Implements Gondwana.Audio.IAudioBackend.

Definition at line 30 of file NAudioAudioBackend.cs.

◆ CreateFromUri()

IAudioPlaybackHandle Gondwana.Audio.NAudio.NAudioAudioBackend.CreateFromUri ( string key,
string uri,
float volume,
float pan,
float playbackSpeed )

Creates an IAudioPlaybackHandle from a URI.

Parameters
keyLogical key for the audio resource (used for logging).
uriThe URI to load audio from.
volumeInitial playback volume in the range [0,1].
panInitial stereo pan in the range [-1,1].
playbackSpeedInitial playback speed multiplier.
Returns
An IAudioPlaybackHandle for the requested resource.
Exceptions
NotSupportedExceptionAlways thrown. URI-based playback is not supported by this backend.

Implements Gondwana.Audio.IAudioBackend.

Property Documentation

◆ Instance

NAudioAudioBackend Gondwana.Audio.NAudio.NAudioAudioBackend.Instance = new()
staticget

Gets the singleton instance of the NAudioAudioBackend.

Definition at line 11 of file NAudioAudioBackend.cs.

◆ Name

string Gondwana.Audio.NAudio.NAudioAudioBackend.Name
get

Gets the display name of this audio backend.

Implements Gondwana.Audio.IAudioBackend.

Definition at line 16 of file NAudioAudioBackend.cs.