Type Sound

Sound type

Methods

isPlaying () Returns whether the sound is being played.
play () Starts to play the sound.
setPitch (pitch, dt) Sets the pitch of the sound.
setSoundLevel (level) Sets the sound level in dB.
setVolume (vol, dt) Sets the volume of the sound.
stop (dt) Stops the sound from being played.


Methods

sound_methods:isPlaying ()
Returns whether the sound is being played.
sound_methods:play ()
Starts to play the sound.
sound_methods:setPitch (pitch, dt)
Sets the pitch of the sound.

Parameters:

  • pitch: Pitch to set to, between 0 and 255.
  • dt: Time in seconds to transition to this new pitch.
sound_methods:setSoundLevel (level)
Sets the sound level in dB.

Parameters:

  • level: dB level, see Valve Dev Wiki, for information on the value to use.
sound_methods:setVolume (vol, dt)
Sets the volume of the sound.

Parameters:

  • vol: Volume to set to, between 0 and 1.
  • dt: Time in seconds to transition to this new volume.
sound_methods:stop (dt)
Stops the sound from being played.

Parameters:

  • dt: Time in seconds to fade out, if nil or 0 the sound stops instantly.

Valid XHTML 1.0!