Sound

The Sound class provides an api to manipulate Sounds. For now it just turns logging for sounds on / off or waits for a list of sounds All the WeakRef stuff seems like overkill and a pia. The problem was if you started the wait and then killed the python script, the entry in the waiters list just stayed forever The only way around this is to have a weakref stored in the list, then if the local var ManualResetEvent went out of scope, the WeakRef will go to null. At end of loop we clean up all null entries so the list stays clean.

Table of Contents

Methods

AddFilter

Syntax: Sound.AddFilter(name, sounds)
Parameters:
  • name (String)
  • sounds (List[Int32])
Returns: Void

Log

Syntax: Sound.Log(activateLogging)

Enables/Disables logging of incoming sound requests

Parameters:
  • activateLogging (Boolean): True= activate sound logging/ False Deactivate sound logging
Returns: Void

OnFilter

Syntax: Sound.OnFilter(p, args)
Parameters:
  • p (PacketReader)
  • args (PacketHandlerEventArgs)
Returns: Void

RemoveFilter

Syntax: Sound.RemoveFilter(name)

Removes a filter of incoming sound requests

Parameters:
  • name (String): The name of the filter to be removed
Returns: Void

WaitForSound

Syntax: Sound.WaitForSound(sounds, timeout)
Parameters:
  • sounds (List[Int32])
  • timeout (Int32)
Returns: Boolean