Barotrauma Client Doc
Barotrauma.Sounds.SoundManager Class Reference
Inheritance diagram for Barotrauma.Sounds.SoundManager:

Public Types

enum class  SourcePoolIndex { Default = 0 , Voice = 1 }
 

Public Member Functions

 SoundManager ()
 
bool InitializeAlcDevice (string deviceName)
 
Sound LoadSound (string filename, bool stream=false)
 
Sound LoadSound (ContentXElement element, bool stream=false, string overrideFilePath=null)
 
SoundChannel GetSoundChannelFromIndex (SourcePoolIndex poolIndex, int ind)
 
uint GetSourceFromIndex (SourcePoolIndex poolIndex, int srcInd)
 
int AssignFreeSourceToChannel (SoundChannel newChannel)
 
bool IsPlaying (Sound sound)
 
int CountPlayingInstances (Sound sound)
 
SoundChannel GetChannelFromSound (Sound sound)
 
void KillChannels (Sound sound)
 
void RemoveSound (Sound sound)
 
void MoveSoundToPosition (Sound sound, int pos)
 
void SetCategoryGainMultiplier (string category, float gain, int index=0)
 
float GetCategoryGainMultiplier (string category, int index=-1)
 
void SetCategoryMuffle (string category, bool muffle)
 
bool GetCategoryMuffle (string category)
 
void Update ()
 
void ApplySettings ()
 
void InitUpdateChannelThread ()
 Initializes the thread that handles streaming audio and fading out and disposing channels that are no longer needed. More...
 
void ForceStreamUpdate ()
 
void Dispose ()
 

Static Public Attributes

const int SOURCE_COUNT = 32
 

Properties

bool Disabled [get]
 
IReadOnlyList< SoundLoadedSounds [get]
 
bool CanDetectDisconnect [get]
 
bool Disconnected [get]
 
Vector3 ListenerPosition [get, set]
 
Vector3 ListenerTargetVector [get, set]
 
Vector3 ListenerUpVector [get, set]
 
float ListenerGain [get, set]
 
float?? PlaybackAmplitude [get]
 
float CompressionDynamicRangeGain [get]
 
float VoipAttenuatedGain [get, set]
 
int LoadedSoundCount [get]
 
int UniqueLoadedSoundCount [get]
 

Detailed Description

Definition at line 12 of file SoundManager.cs.

Member Enumeration Documentation

◆ SourcePoolIndex

Enumerator
Default 
Voice 

Definition at line 25 of file SoundManager.cs.

Constructor & Destructor Documentation

◆ SoundManager()

Barotrauma.Sounds.SoundManager.SoundManager ( )

Definition at line 201 of file SoundManager.cs.

Member Function Documentation

◆ ApplySettings()

void Barotrauma.Sounds.SoundManager.ApplySettings ( )

Definition at line 722 of file SoundManager.cs.

◆ AssignFreeSourceToChannel()

int Barotrauma.Sounds.SoundManager.AssignFreeSourceToChannel ( SoundChannel  newChannel)

Definition at line 407 of file SoundManager.cs.

◆ CountPlayingInstances()

int Barotrauma.Sounds.SoundManager.CountPlayingInstances ( Sound  sound)

Definition at line 460 of file SoundManager.cs.

◆ Dispose()

void Barotrauma.Sounds.SoundManager.Dispose ( )

Definition at line 857 of file SoundManager.cs.

◆ ForceStreamUpdate()

void Barotrauma.Sounds.SoundManager.ForceStreamUpdate ( )

Definition at line 813 of file SoundManager.cs.

◆ GetCategoryGainMultiplier()

float Barotrauma.Sounds.SoundManager.GetCategoryGainMultiplier ( string  category,
int  index = -1 
)

Definition at line 569 of file SoundManager.cs.

◆ GetCategoryMuffle()

bool Barotrauma.Sounds.SoundManager.GetCategoryMuffle ( string  category)

Definition at line 624 of file SoundManager.cs.

◆ GetChannelFromSound()

SoundChannel Barotrauma.Sounds.SoundManager.GetChannelFromSound ( Sound  sound)

Definition at line 478 of file SoundManager.cs.

◆ GetSoundChannelFromIndex()

SoundChannel Barotrauma.Sounds.SoundManager.GetSoundChannelFromIndex ( SourcePoolIndex  poolIndex,
int  ind 
)

Definition at line 389 of file SoundManager.cs.

◆ GetSourceFromIndex()

uint Barotrauma.Sounds.SoundManager.GetSourceFromIndex ( SourcePoolIndex  poolIndex,
int  srcInd 
)

Definition at line 395 of file SoundManager.cs.

◆ InitializeAlcDevice()

bool Barotrauma.Sounds.SoundManager.InitializeAlcDevice ( string  deviceName)

Definition at line 245 of file SoundManager.cs.

◆ InitUpdateChannelThread()

void Barotrauma.Sounds.SoundManager.InitUpdateChannelThread ( )

Initializes the thread that handles streaming audio and fading out and disposing channels that are no longer needed.

Definition at line 734 of file SoundManager.cs.

◆ IsPlaying()

bool Barotrauma.Sounds.SoundManager.IsPlaying ( Sound  sound)

Definition at line 443 of file SoundManager.cs.

◆ KillChannels()

void Barotrauma.Sounds.SoundManager.KillChannels ( Sound  sound)

Definition at line 495 of file SoundManager.cs.

◆ LoadSound() [1/2]

Sound Barotrauma.Sounds.SoundManager.LoadSound ( ContentXElement  element,
bool  stream = false,
string  overrideFilePath = null 
)

Definition at line 364 of file SoundManager.cs.

◆ LoadSound() [2/2]

Sound Barotrauma.Sounds.SoundManager.LoadSound ( string  filename,
bool  stream = false 
)

Definition at line 347 of file SoundManager.cs.

◆ MoveSoundToPosition()

void Barotrauma.Sounds.SoundManager.MoveSoundToPosition ( Sound  sound,
int  pos 
)

Definition at line 526 of file SoundManager.cs.

◆ RemoveSound()

void Barotrauma.Sounds.SoundManager.RemoveSound ( Sound  sound)

Definition at line 511 of file SoundManager.cs.

◆ SetCategoryGainMultiplier()

void Barotrauma.Sounds.SoundManager.SetCategoryGainMultiplier ( string  category,
float  gain,
int  index = 0 
)

Definition at line 538 of file SoundManager.cs.

◆ SetCategoryMuffle()

void Barotrauma.Sounds.SoundManager.SetCategoryMuffle ( string  category,
bool  muffle 
)

Definition at line 592 of file SoundManager.cs.

◆ Update()

void Barotrauma.Sounds.SoundManager.Update ( )

Definition at line 636 of file SoundManager.cs.

Member Data Documentation

◆ SOURCE_COUNT

const int Barotrauma.Sounds.SoundManager.SOURCE_COUNT = 32
static

Definition at line 14 of file SoundManager.cs.

Property Documentation

◆ CanDetectDisconnect

bool Barotrauma.Sounds.SoundManager.CanDetectDisconnect
get

Definition at line 38 of file SoundManager.cs.

◆ CompressionDynamicRangeGain

float Barotrauma.Sounds.SoundManager.CompressionDynamicRangeGain
get

Definition at line 139 of file SoundManager.cs.

◆ Disabled

bool Barotrauma.Sounds.SoundManager.Disabled
get

Definition at line 16 of file SoundManager.cs.

◆ Disconnected

bool Barotrauma.Sounds.SoundManager.Disconnected
get

Definition at line 40 of file SoundManager.cs.

◆ ListenerGain

float Barotrauma.Sounds.SoundManager.ListenerGain
getset

Definition at line 94 of file SoundManager.cs.

◆ ListenerPosition

Vector3 Barotrauma.Sounds.SoundManager.ListenerPosition
getset

Definition at line 45 of file SoundManager.cs.

◆ ListenerTargetVector

Vector3 Barotrauma.Sounds.SoundManager.ListenerTargetVector
getset

Definition at line 62 of file SoundManager.cs.

◆ ListenerUpVector

Vector3 Barotrauma.Sounds.SoundManager.ListenerUpVector
getset

Definition at line 77 of file SoundManager.cs.

◆ LoadedSoundCount

int Barotrauma.Sounds.SoundManager.LoadedSoundCount
get

Definition at line 153 of file SoundManager.cs.

◆ LoadedSounds

IReadOnlyList<Sound> Barotrauma.Sounds.SoundManager.LoadedSounds
get

Definition at line 33 of file SoundManager.cs.

◆ PlaybackAmplitude

float?? Barotrauma.Sounds.SoundManager.PlaybackAmplitude
get

Definition at line 111 of file SoundManager.cs.

◆ UniqueLoadedSoundCount

int Barotrauma.Sounds.SoundManager.UniqueLoadedSoundCount
get

Definition at line 157 of file SoundManager.cs.

◆ VoipAttenuatedGain

float Barotrauma.Sounds.SoundManager.VoipAttenuatedGain
getset

Definition at line 143 of file SoundManager.cs.