M&B: Bannerlord 1.1.0
The horns sound, the ravens gather.
Loading...
Searching...
No Matches
TaleWorlds.Engine.SoundEvent Class Reference

Defines any sound instance, used with events.

Public Member Functions

int GetSoundId ()
 
void SetEventMinMaxDistance (Vec3 newRadius)
 
bool IsNullSoundEvent ()
 
bool Play ()
 Plays this instance.
 
void Pause ()
 Pauses this instance.
 
void Resume ()
 Resumes this instance.
 
void PlayExtraEvent (string eventName)
 
void SetSwitch (string switchGroupName, string newSwitchStateName)
 
void TriggerCue ()
 
bool PlayInPosition (Vec3 position)
 Sets the position first and plays this instance. Danger: sets the position permanently! any other StartEvent calls after this call, will be in this position.
 
void Stop ()
 Stops this instance.
 
void SetParameter (string parameterName, float value)
 Sets the parameter.
 
void SetParameter (int parameterIndex, float value)
 
Vec3 GetEventMinMaxDistance ()
 
void SetPosition (Vec3 vec)
 Sets the position.
 
void SetVelocity (Vec3 vec)
 Sets the velocity.
 
void Release ()
 Releases this instance.
 
bool IsPlaying ()
 
bool IsPaused ()
 

Static Public Member Functions

static SoundEvent CreateEventFromString (string eventId, Scene scene)
 Creates the event from fmod a fev file.
 
static int GetEventIdFromString (string name)
 
static bool PlaySound2D (int soundCodeId)
 
static bool PlaySound2D (string soundName)
 
static int GetTotalEventCount ()
 Get the total amount of sound events.
 
static SoundEvent CreateEvent (int soundCodeId, Scene scene)
 Creates the event from fmod a fev file.
 
static SoundEvent CreateEventFromSoundBuffer (string eventId, byte[] soundData, Scene scene)
 
static SoundEvent CreateEventFromExternalFile (string programmerEventName, string soundFilePath, Scene scene)
 

Properties

bool IsValid [get]
 Gets a value indicating whether this instance is valid.
 

Member Function Documentation

◆ GetSoundId()

int TaleWorlds.Engine.SoundEvent.GetSoundId ( )

◆ CreateEventFromString()

static SoundEvent TaleWorlds.Engine.SoundEvent.CreateEventFromString ( string  eventId,
Scene  scene 
)
static
Parameters
groupIdThe group _soundId.
eventIdThe event _soundId.
Returns
MBSound instance containing the sound data

◆ SetEventMinMaxDistance()

void TaleWorlds.Engine.SoundEvent.SetEventMinMaxDistance ( Vec3  newRadius)

◆ GetEventIdFromString()

static int TaleWorlds.Engine.SoundEvent.GetEventIdFromString ( string  name)
static

◆ PlaySound2D() [1/2]

static bool TaleWorlds.Engine.SoundEvent.PlaySound2D ( int  soundCodeId)
static

◆ PlaySound2D() [2/2]

static bool TaleWorlds.Engine.SoundEvent.PlaySound2D ( string  soundName)
static

◆ GetTotalEventCount()

static int TaleWorlds.Engine.SoundEvent.GetTotalEventCount ( )
static
Returns
returns the amount

◆ CreateEvent()

static SoundEvent TaleWorlds.Engine.SoundEvent.CreateEvent ( int  soundCodeId,
Scene  scene 
)
static
Parameters
soundCodeIdID of the sound
Returns
MBSound instance containing the sound data

◆ IsNullSoundEvent()

bool TaleWorlds.Engine.SoundEvent.IsNullSoundEvent ( )

◆ Play()

bool TaleWorlds.Engine.SoundEvent.Play ( )
Returns
True if played successfully, otherwise, false.

◆ Pause()

void TaleWorlds.Engine.SoundEvent.Pause ( )

◆ Resume()

void TaleWorlds.Engine.SoundEvent.Resume ( )

◆ PlayExtraEvent()

void TaleWorlds.Engine.SoundEvent.PlayExtraEvent ( string  eventName)

◆ SetSwitch()

void TaleWorlds.Engine.SoundEvent.SetSwitch ( string  switchGroupName,
string  newSwitchStateName 
)

◆ TriggerCue()

void TaleWorlds.Engine.SoundEvent.TriggerCue ( )

◆ PlayInPosition()

bool TaleWorlds.Engine.SoundEvent.PlayInPosition ( Vec3  position)
Parameters
positionSets the events position to this parameter permanently
Returns
True if played successfully, otherwise, false.

◆ Stop()

void TaleWorlds.Engine.SoundEvent.Stop ( )

◆ SetParameter() [1/2]

void TaleWorlds.Engine.SoundEvent.SetParameter ( string  parameterName,
float  value 
)
Parameters
parameterNameName of the parameter.
valueValue of the parameter.

◆ SetParameter() [2/2]

void TaleWorlds.Engine.SoundEvent.SetParameter ( int  parameterIndex,
float  value 
)

◆ GetEventMinMaxDistance()

Vec3 TaleWorlds.Engine.SoundEvent.GetEventMinMaxDistance ( )

◆ SetPosition()

void TaleWorlds.Engine.SoundEvent.SetPosition ( Vec3  vec)
Parameters
vecNew position

◆ SetVelocity()

void TaleWorlds.Engine.SoundEvent.SetVelocity ( Vec3  vec)
Parameters
vecThe vec.

◆ Release()

void TaleWorlds.Engine.SoundEvent.Release ( )

◆ IsPlaying()

bool TaleWorlds.Engine.SoundEvent.IsPlaying ( )

◆ IsPaused()

bool TaleWorlds.Engine.SoundEvent.IsPaused ( )

◆ CreateEventFromSoundBuffer()

static SoundEvent TaleWorlds.Engine.SoundEvent.CreateEventFromSoundBuffer ( string  eventId,
byte[]  soundData,
Scene  scene 
)
static

◆ CreateEventFromExternalFile()

static SoundEvent TaleWorlds.Engine.SoundEvent.CreateEventFromExternalFile ( string  programmerEventName,
string  soundFilePath,
Scene  scene 
)
static

Property Documentation

◆ IsValid

bool TaleWorlds.Engine.SoundEvent.IsValid
get

true if this instance is valid; otherwise, false.