Table of Contents

Class SourceConfiguration

Namespace
Bonsai.Audio.Configuration
Assembly
Bonsai.Audio.dll

Provides configuration and loading functionality for audio sources.

public class SourceConfiguration : ResourceConfiguration<AudioSource>, IResourceConfiguration
Inheritance
SourceConfiguration
Implements
Inherited Members

Properties

BufferName

Gets or sets the optional name of a buffer to play when creating the source.

[TypeConverter(typeof(BufferNameConverter))]
public string BufferName { get; set; }

Property Value

string

Direction

Gets or sets the direction vector of the audio source.

[TypeConverter(typeof(NumericRecordConverter))]
public Vector3 Direction { get; set; }

Property Value

Vector3

Gain

Gets or sets the volume amplification applied to the audio source.

[Precision(2, 0.01)]
[Range(0, 2147483647)]
public float Gain { get; set; }

Property Value

float

Looping

Gets or sets a value indicating whether the audio source is looping.

public bool Looping { get; set; }

Property Value

bool

Pitch

Gets or sets the pitch to be applied to the audio source.

[Range(0.5, 2)]
[Precision(2, 0.01)]
public float Pitch { get; set; }

Property Value

float

Position

Gets or sets the location of the audio source in three-dimensional space.

[TypeConverter(typeof(NumericRecordConverter))]
public Vector3 Position { get; set; }

Property Value

Vector3

Relative

Gets or sets a value indicating whether the audio source uses coordinates relative to the listener.

public bool Relative { get; set; }

Property Value

bool

State

Gets or sets a value specifying the state to which the source should be set after creation.

public ALSourceState State { get; set; }

Property Value

ALSourceState

Velocity

Gets or sets the velocity of the audio source in three-dimensional space.

[TypeConverter(typeof(NumericRecordConverter))]
public Vector3 Velocity { get; set; }

Property Value

Vector3

Methods

CreateResource(ResourceManager)

Creates a new source of spatialized audio.

public override AudioSource CreateResource(ResourceManager resourceManager)

Parameters

resourceManager ResourceManager

The ResourceManager object onto which this resource will be loaded. The resource manager can be accessed to load additional resource dependencies which may be required to create the new resource.

Returns

AudioSource

A new instance of the AudioSource class.