Baldi's Basics Plus Glue API
Modding API for Baldi's Basics Plus
Loading...
Searching...
No Matches
BBPGlue.API.BBPAudioManager Class Referencesealed

Provides a wrapper around the game's audio manager exposing playback and queue controls. More...

Public Member Functions

 BBPAudioManager (object? raw)
 Initializes a new instance of the BBPAudioManager class wrapping a raw audio manager.
void DisableVolumetricAudio ()
 Disables volumetric audio processing for this manager.
void FadeOut (float time)
 Fades out audio over the specified duration.
void Flush (bool endCurrent=true)
 Flushes the audio queue, optionally ending the current playback.
void OverrideSourcePosition (Vector3 position)
 Overrides the audio source position with the specified world position.
void Pause (bool pause)
 Pauses or resumes audio playback.
void PlayRandom (object soundArray)
 Plays a random element from the provided sound array immediately.
void PlaySingle (BBPSoundObject sound)
 Plays a single instance of the specified sound immediately.
void PlaySingle (BBPSoundObject sound, float volumeScale)
 Plays a single instance of the specified sound with a volume scale.
void Queue (BBPSoundObject sound, bool playImmediately=false)
 Queues a sound for playback, optionally playing it immediately.
void QueueRandom (object soundArray)
 Queues a random element from the provided sound array for playback.
void ReleaseSourcePositionOverride ()
 Releases any previously set source position override.
void SetLoop (bool value)
 Sets the loop state on the underlying audio manager.
void SetVolumetricAudio (object positions)
 Sets volumetric audio positions for the manager.

Properties

bool AnyAudioIsPlaying [get]
 Gets whether any audio is currently playing through this manager.
AudioSource? AudioSource [get]
 Gets the underlying AudioSource used by the manager.
object? AudioSourceManager [get]
 Gets the audio source manager object associated with this manager.
Vector2 CaptionAnchor [get, set]
 Gets or sets the anchor position for captions related to audio.
Vector3 CaptionPosition [get, set]
 Gets or sets the position used for caption display related to audio.
bool Exists [get]
 Determines whether the underlying raw object exists.
int FilesQueued [get]
 Gets the number of audio files currently queued.
bool IgnoreListenerPause [get, set]
 Gets or sets whether this manager ignores the global listener pause state.
bool IsPropagated [get]
 Gets whether the underlying manager is a propagated audio manager type.
bool Loop [get, set]
 Gets or sets whether the audio manager should loop playback.
bool MaintainLoop [get, set]
 Gets or sets whether loop state should be maintained across queued items.
float PitchModifier [get, set]
 Gets or sets the pitch multiplier applied to audio playback.
bool Positional [get, set]
 Gets or sets whether audio is positional in world space.
object? PropagationSource [get]
 Gets the propagation source object if this manager propagates audio.
bool QueuedAudioIsPlaying [get]
 Gets whether queued audio is currently playing.
bool QueuedUp [get]
 Gets whether audio is currently queued up for playback.
object? Raw [get]
 The raw underlying audio manager object wrapped by this API class, or null if none.
int SourceId [get]
 Gets the identifier of the audio source used by this manager.
Vector3 SourcePosition [get]
 Gets the current source position used for positional audio.
bool UseUnscaledPitch [get, set]
 Gets or sets whether pitch is applied without time scaling.
float VolumeModifier [get, set]
 Gets or sets the volume multiplier applied to audio playback.

Detailed Description

Provides a wrapper around the game's audio manager exposing playback and queue controls.

Constructor & Destructor Documentation

◆ BBPAudioManager()

BBPGlue.API.BBPAudioManager.BBPAudioManager ( object? raw)

Initializes a new instance of the BBPAudioManager class wrapping a raw audio manager.

Parameters
rawThe raw underlying object instance or null.

Member Function Documentation

◆ DisableVolumetricAudio()

void BBPGlue.API.BBPAudioManager.DisableVolumetricAudio ( )

Disables volumetric audio processing for this manager.

◆ FadeOut()

void BBPGlue.API.BBPAudioManager.FadeOut ( float time)

Fades out audio over the specified duration.

Parameters
timeFade out duration in seconds.

◆ Flush()

void BBPGlue.API.BBPAudioManager.Flush ( bool endCurrent = true)

Flushes the audio queue, optionally ending the current playback.

Parameters
endCurrentIf true, end the current playback immediately.

◆ OverrideSourcePosition()

void BBPGlue.API.BBPAudioManager.OverrideSourcePosition ( Vector3 position)

Overrides the audio source position with the specified world position.

Parameters
positionThe position to override the source with.

◆ Pause()

void BBPGlue.API.BBPAudioManager.Pause ( bool pause)

Pauses or resumes audio playback.

Parameters
pauseTrue to pause; false to resume.

◆ PlayRandom()

void BBPGlue.API.BBPAudioManager.PlayRandom ( object soundArray)

Plays a random element from the provided sound array immediately.

Parameters
soundArrayAn array or collection of sound objects.

◆ PlaySingle() [1/2]

void BBPGlue.API.BBPAudioManager.PlaySingle ( BBPSoundObject sound)

Plays a single instance of the specified sound immediately.

Parameters
soundThe sound to play.

◆ PlaySingle() [2/2]

void BBPGlue.API.BBPAudioManager.PlaySingle ( BBPSoundObject sound,
float volumeScale )

Plays a single instance of the specified sound with a volume scale.

Parameters
soundThe sound to play.
volumeScaleVolume scale to apply to the sound.

◆ Queue()

void BBPGlue.API.BBPAudioManager.Queue ( BBPSoundObject sound,
bool playImmediately = false )

Queues a sound for playback, optionally playing it immediately.

Parameters
soundThe sound to queue.
playImmediatelyWhether the sound should play immediately.

◆ QueueRandom()

void BBPGlue.API.BBPAudioManager.QueueRandom ( object soundArray)

Queues a random element from the provided sound array for playback.

Parameters
soundArrayAn array or collection of sound objects.

◆ ReleaseSourcePositionOverride()

void BBPGlue.API.BBPAudioManager.ReleaseSourcePositionOverride ( )

Releases any previously set source position override.

◆ SetLoop()

void BBPGlue.API.BBPAudioManager.SetLoop ( bool value)

Sets the loop state on the underlying audio manager.

Parameters
valueTrue to enable looping; false to disable.

◆ SetVolumetricAudio()

void BBPGlue.API.BBPAudioManager.SetVolumetricAudio ( object positions)

Sets volumetric audio positions for the manager.

Parameters
positionsAn object representing positions used for volumetric audio.

Property Documentation

◆ AnyAudioIsPlaying

bool BBPGlue.API.BBPAudioManager.AnyAudioIsPlaying
get

Gets whether any audio is currently playing through this manager.

Returns
True if audio is playing; otherwise false.

◆ AudioSource

AudioSource? BBPGlue.API.BBPAudioManager.AudioSource
get

Gets the underlying AudioSource used by the manager.

Returns
The AudioSource or null.

◆ AudioSourceManager

object? BBPGlue.API.BBPAudioManager.AudioSourceManager
get

Gets the audio source manager object associated with this manager.

Returns
The audio source manager object or null.

◆ CaptionAnchor

Vector2 BBPGlue.API.BBPAudioManager.CaptionAnchor
getset

Gets or sets the anchor position for captions related to audio.

Returns
The caption anchor as a Vector2.

◆ CaptionPosition

Vector3 BBPGlue.API.BBPAudioManager.CaptionPosition
getset

Gets or sets the position used for caption display related to audio.

Returns
The caption position as a Vector3.

◆ Exists

bool BBPGlue.API.BBPAudioManager.Exists
get

Determines whether the underlying raw object exists.

◆ FilesQueued

int BBPGlue.API.BBPAudioManager.FilesQueued
get

Gets the number of audio files currently queued.

Returns
The count of files queued.

◆ IgnoreListenerPause

bool BBPGlue.API.BBPAudioManager.IgnoreListenerPause
getset

Gets or sets whether this manager ignores the global listener pause state.

Returns
True if listener pause is ignored; otherwise false.

◆ IsPropagated

bool BBPGlue.API.BBPAudioManager.IsPropagated
get

Gets whether the underlying manager is a propagated audio manager type.

Returns
True if the underlying type name equals "PropagatedAudioManager"; otherwise false.

◆ Loop

bool BBPGlue.API.BBPAudioManager.Loop
getset

Gets or sets whether the audio manager should loop playback.

Returns
True if looping; otherwise false.

◆ MaintainLoop

bool BBPGlue.API.BBPAudioManager.MaintainLoop
getset

Gets or sets whether loop state should be maintained across queued items.

Returns
True if maintain loop is enabled; otherwise false.

◆ PitchModifier

float BBPGlue.API.BBPAudioManager.PitchModifier
getset

Gets or sets the pitch multiplier applied to audio playback.

Returns
The pitch modifier as a float.

◆ Positional

bool BBPGlue.API.BBPAudioManager.Positional
getset

Gets or sets whether audio is positional in world space.

Returns
True if positional audio is enabled; otherwise false.

◆ PropagationSource

object? BBPGlue.API.BBPAudioManager.PropagationSource
get

Gets the propagation source object if this manager propagates audio.

Returns
The propagation source object or null.

◆ QueuedAudioIsPlaying

bool BBPGlue.API.BBPAudioManager.QueuedAudioIsPlaying
get

Gets whether queued audio is currently playing.

Returns
True if queued audio is playing; otherwise false.

◆ QueuedUp

bool BBPGlue.API.BBPAudioManager.QueuedUp
get

Gets whether audio is currently queued up for playback.

Returns
True if queued; otherwise false.

◆ Raw

object? BBPGlue.API.BBPAudioManager.Raw
get

The raw underlying audio manager object wrapped by this API class, or null if none.

◆ SourceId

int BBPGlue.API.BBPAudioManager.SourceId
get

Gets the identifier of the audio source used by this manager.

Returns
The source identifier as an integer.

◆ SourcePosition

Vector3 BBPGlue.API.BBPAudioManager.SourcePosition
get

Gets the current source position used for positional audio.

Returns
The source position as a Vector3.

◆ UseUnscaledPitch

bool BBPGlue.API.BBPAudioManager.UseUnscaledPitch
getset

Gets or sets whether pitch is applied without time scaling.

Returns
True if unscaled pitch is used; otherwise false.

◆ VolumeModifier

float BBPGlue.API.BBPAudioManager.VolumeModifier
getset

Gets or sets the volume multiplier applied to audio playback.

Returns
The volume modifier as a float.

The documentation for this class was generated from the following file: