Skip to content

AudioAPI reference

Interface IAudioStream

Namespace: MicroEngine.Audio
Assembly: MicroEngine.Audio.dll
Guide: Audio

Streamed audio (music decoded while it plays). The engine reads it only in Pump, on the main thread outside the simulation step, ahead of the sink.

C#
public interface IAudioStream : IDisposable

Implements

IDisposable

Properties

Channels

1 or 2.

C#
int Channels { get; }

Property Value

int

SampleRate

Frames per second.

C#
int SampleRate { get; }

Property Value

int

Methods

Read(Span<float>)

Fills buffer with interleaved samples; returns how many it wrote, 0 at the end.

C#
int Read(Span<float> buffer)

Parameters

buffer Span<float>

Returns

int

Rewind()

Goes back to the start (looping).

C#
void Rewind()