Table of Contents

Class AudioLayer

Namespace
Stride.Audio
Assembly
Stride.Audio.dll

Wrapper around OpenAL

public class AudioLayer
Inheritance
AudioLayer

Methods

BufferCreate(int)

public static extern AudioLayer.Buffer BufferCreate(int maxBufferSizeBytes)

Parameters

maxBufferSizeBytes int

Returns

AudioLayer.Buffer

BufferDestroy(Buffer)

public static extern void BufferDestroy(AudioLayer.Buffer buffer)

Parameters

buffer AudioLayer.Buffer

BufferFill(Buffer, IntPtr, int, int, bool)

public static extern void BufferFill(AudioLayer.Buffer buffer, IntPtr pcm, int bufferSize, int sampleRate, bool mono)

Parameters

buffer AudioLayer.Buffer
pcm IntPtr
bufferSize int
sampleRate int
mono bool

Create(string, DeviceFlags)

public static extern AudioLayer.Device Create(string deviceName, AudioLayer.DeviceFlags flags)

Parameters

deviceName string
flags AudioLayer.DeviceFlags

Returns

AudioLayer.Device

Destroy(Device)

public static extern void Destroy(AudioLayer.Device device)

Parameters

device AudioLayer.Device

Init()

public static extern bool Init()

Returns

bool

ListenerCreate(Device)

public static extern AudioLayer.Listener ListenerCreate(AudioLayer.Device device)

Parameters

device AudioLayer.Device

Returns

AudioLayer.Listener

ListenerDestroy(Listener)

public static extern void ListenerDestroy(AudioLayer.Listener listener)

Parameters

listener AudioLayer.Listener

ListenerDisable(Listener)

public static extern void ListenerDisable(AudioLayer.Listener listener)

Parameters

listener AudioLayer.Listener

ListenerEnable(Listener)

public static extern bool ListenerEnable(AudioLayer.Listener listener)

Parameters

listener AudioLayer.Listener

Returns

bool

ListenerPush3D(Listener, ref Vector3, ref Vector3, ref Vector3, ref Vector3, ref Matrix)

public static extern void ListenerPush3D(AudioLayer.Listener listener, ref Vector3 pos, ref Vector3 forward, ref Vector3 up, ref Vector3 vel, ref Matrix worldTransform)

Parameters

listener AudioLayer.Listener
pos Vector3
forward Vector3
up Vector3
vel Vector3
worldTransform Matrix

SetMasterVolume(Device, float)

public static extern void SetMasterVolume(AudioLayer.Device device, float volume)

Parameters

device AudioLayer.Device
volume float

SourceCreate(Listener, int, int, bool, bool, bool, bool, float, HrtfEnvironment)

public static extern AudioLayer.Source SourceCreate(AudioLayer.Listener listener, int sampleRate, int maxNumberOfBuffers, bool mono, bool spatialized, bool streamed, bool hrtf, float hrtfDirectionFactor, HrtfEnvironment environment)

Parameters

listener AudioLayer.Listener
sampleRate int
maxNumberOfBuffers int
mono bool
spatialized bool
streamed bool
hrtf bool
hrtfDirectionFactor float
environment HrtfEnvironment

Returns

AudioLayer.Source

SourceDestroy(Source)

public static extern void SourceDestroy(AudioLayer.Source source)

Parameters

source AudioLayer.Source

SourceFlushBuffers(Source)

public static extern void SourceFlushBuffers(AudioLayer.Source source)

Parameters

source AudioLayer.Source

SourceGetFreeBuffer(Source)

public static extern AudioLayer.Buffer SourceGetFreeBuffer(AudioLayer.Source source)

Parameters

source AudioLayer.Source

Returns

AudioLayer.Buffer

SourceGetPosition(Source)

public static extern double SourceGetPosition(AudioLayer.Source source)

Parameters

source AudioLayer.Source

Returns

double

SourceIsPlaying(Source)

public static extern bool SourceIsPlaying(AudioLayer.Source source)

Parameters

source AudioLayer.Source

Returns

bool

SourcePause(Source)

public static extern void SourcePause(AudioLayer.Source source)

Parameters

source AudioLayer.Source

SourcePlay(Source)

public static extern void SourcePlay(AudioLayer.Source source)

Parameters

source AudioLayer.Source

SourcePush3D(Source, ref Vector3, ref Vector3, ref Vector3, ref Vector3, ref Matrix)

public static extern void SourcePush3D(AudioLayer.Source source, ref Vector3 pos, ref Vector3 forward, ref Vector3 up, ref Vector3 vel, ref Matrix worldTransform)

Parameters

source AudioLayer.Source
pos Vector3
forward Vector3
up Vector3
vel Vector3
worldTransform Matrix

SourceQueueBuffer(Source, Buffer, IntPtr, int, BufferType)

public static extern void SourceQueueBuffer(AudioLayer.Source source, AudioLayer.Buffer buffer, IntPtr pcm, int bufferSize, AudioLayer.BufferType streamType)

Parameters

source AudioLayer.Source
buffer AudioLayer.Buffer
pcm IntPtr
bufferSize int
streamType AudioLayer.BufferType

SourceSetBuffer(Source, Buffer)

public static extern void SourceSetBuffer(AudioLayer.Source source, AudioLayer.Buffer buffer)

Parameters

source AudioLayer.Source
buffer AudioLayer.Buffer

SourceSetGain(Source, float)

public static extern void SourceSetGain(AudioLayer.Source source, float gain)

Parameters

source AudioLayer.Source
gain float

SourceSetLooping(Source, bool)

public static extern void SourceSetLooping(AudioLayer.Source source, bool looped)

Parameters

source AudioLayer.Source
looped bool

SourceSetPan(Source, float)

public static extern void SourceSetPan(AudioLayer.Source source, float pan)

Parameters

source AudioLayer.Source
pan float

SourceSetPitch(Source, float)

public static extern void SourceSetPitch(AudioLayer.Source source, float pitch)

Parameters

source AudioLayer.Source
pitch float

SourceSetRange(Source, double, double)

public static extern void SourceSetRange(AudioLayer.Source source, double startTime, double stopTime)

Parameters

source AudioLayer.Source
startTime double
stopTime double

SourceStop(Source)

public static extern void SourceStop(AudioLayer.Source source)

Parameters

source AudioLayer.Source

Update(Device)

public static extern void Update(AudioLayer.Device device)

Parameters

device AudioLayer.Device