Gondwana Game Engine
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, mobile, and web platforms using SkiaSharp for graphics and NAudio for sound.
Loading...
Searching...
No Matches
Gondwana.Audio.StereoPanSampleProvider Class Referencesealed

Simple stereo balancer: multiplies L/R samples independently. Expects stereo IEEE float (NAudio will convert upstream via ToSampleProvider()). More...

Inheritance diagram for Gondwana.Audio.StereoPanSampleProvider:

Public Member Functions

 StereoPanSampleProvider (ISampleProvider source)
 Initializes a new instance of the StereoPanSampleProvider class with the specified stereo sample source.
int Read (float[] buffer, int offset, int count)
 Reads samples from the source and applies independent left and right channel volume adjustments.

Properties

float LeftVolume [get, set]
 Gets or sets the volume multiplier for the left channel.
float RightVolume [get, set]
 Gets or sets the volume multiplier for the right channel.
WaveFormat WaveFormat [get]
 Gets the wave format of the sample provider.

Detailed Description

Simple stereo balancer: multiplies L/R samples independently. Expects stereo IEEE float (NAudio will convert upstream via ToSampleProvider()).

Constructor & Destructor Documentation

◆ StereoPanSampleProvider()

Gondwana.Audio.StereoPanSampleProvider.StereoPanSampleProvider ( ISampleProvider source)

Initializes a new instance of the StereoPanSampleProvider class with the specified stereo sample source.

Parameters
sourceThe stereo sample source to apply panning to. Must be stereo (2 channels) and use IEEE float encoding.
Exceptions
ArgumentExceptionThrown when the source is not stereo (2 channels) or does not use IEEE float encoding.

Member Function Documentation

◆ Read()

int Gondwana.Audio.StereoPanSampleProvider.Read ( float[] buffer,
int offset,
int count )

Reads samples from the source and applies independent left and right channel volume adjustments.

Parameters
bufferThe buffer to fill with samples.
offsetThe offset in the buffer to start writing samples.
countThe number of samples to read.
Returns
The number of samples actually read from the source.

Property Documentation

◆ LeftVolume

float Gondwana.Audio.StereoPanSampleProvider.LeftVolume
getset

Gets or sets the volume multiplier for the left channel.

A value of 1.0 represents full volume. Values between 0.0 and 1.0 reduce volume, while values greater than 1.0 can provide gain.

◆ RightVolume

float Gondwana.Audio.StereoPanSampleProvider.RightVolume
getset

Gets or sets the volume multiplier for the right channel.

A value of 1.0 represents full volume. Values between 0.0 and 1.0 reduce volume, while values greater than 1.0 can provide gain.

◆ WaveFormat

WaveFormat Gondwana.Audio.StereoPanSampleProvider.WaveFormat
get

Gets the wave format of the sample provider.

Returns the wave format from the underlying source provider.