IsSoundPaused: Difference between revisions
Jump to navigation
Jump to search
No edit summary |
(Added Example) |
||
Line 13: | Line 13: | ||
==Example== | ==Example== | ||
This example will check and see if the sound is paused or not, and tell the player. | |||
<section name="Client" class="client" show="true"> | <section name="Client" class="client" show="true"> | ||
<syntaxhighlight lang="lua"> | <syntaxhighlight lang="lua"> | ||
theSound = playSound("music/song.mp3") | |||
function checkSongPause() | |||
local pause = isSoundPaused(theSound) | |||
if(pause == true) then | |||
outputChatBox("The sound is paused!", getLocalPlayer()) | |||
else | |||
outputChatBox("The sound is not paused!", getLocalPlayer()) | |||
end | |||
end | |||
addCommandHandler("checkpause", checkSongPause) | |||
</syntaxhighlight> | </syntaxhighlight> | ||
</section> | </section> |
Revision as of 12:41, 28 November 2009
This function is used to return the current pause state of the specified sound element.
Syntax
bool isSoundPaused ( element theSound )
Required Arguments
- theSound: The sound element which pause state you want to return.
Returns
Returns true if the sound element is paused, false if unpaused or invalid arguments were passed.
Example
This example will check and see if the sound is paused or not, and tell the player.
Click to collapse [-]
ClienttheSound = playSound("music/song.mp3") function checkSongPause() local pause = isSoundPaused(theSound) if(pause == true) then outputChatBox("The sound is paused!", getLocalPlayer()) else outputChatBox("The sound is not paused!", getLocalPlayer()) end end addCommandHandler("checkpause", checkSongPause)
See Also
- getRadioChannel
- getRadioChannelName
- getSFXStatus
- getSoundBPM
- getSoundBufferLength
- getSoundEffectParameters
- getSoundEffects
- getSoundFFTData
- getSoundLength
- getSoundLevelData
- getSoundMaxDistance
- getSoundMetaTags
- getSoundMinDistance
- getSoundPan
- getSoundPosition
- getSoundProperties
- getSoundSpeed
- getSoundVolume
- getSoundWaveData
- isSoundLooped
- isSoundPanningEnabled
- isSoundPaused
- playSFX3D
- playSFX
- playSound3D
- playSound
- setRadioChannel
- setSoundEffectEnabled
- setSoundEffectParameter
- setSoundLooped
- setSoundMaxDistance
- setSoundMinDistance
- setSoundPan
- setSoundPanningEnabled
- setSoundPaused
- setSoundPosition
- setSoundProperties
- setSoundSpeed
- setSoundVolume
- stopSound
- Shared
- playSoundFrontEnd