SetSoundPaused: Difference between revisions
Jump to navigation
Jump to search
No edit summary |
mNo edit summary |
||
(3 intermediate revisions by 2 users not shown) | |||
Line 1: | Line 1: | ||
__NOTOC__ | __NOTOC__ | ||
{{Client function}} | {{Client function}} | ||
This function is used to either pause or unpause the playback of the specified [[sound]] element. | This function is used to either pause or unpause the playback of the specified [[sound]] [[element]]. | ||
{{New feature/item|3.0132|1.3.2|| | |||
Use a player element to control a players voice with this function. | Use a player element to control a players voice with this function. | ||
}} | |||
==Syntax== | ==Syntax== | ||
<syntaxhighlight lang="lua">bool setSoundPaused ( element theSound, bool paused )</syntaxhighlight> | <syntaxhighlight lang="lua">bool setSoundPaused ( element theSound, bool paused )</syntaxhighlight> | ||
{{OOP||[[sound]]:setPaused|paused|isSoundPaused}} | |||
===Required Arguments=== | ===Required Arguments=== | ||
*'''theSound:''' | *'''theSound:''' the [[sound]] [[element]] which you want to pause/unpause. | ||
*'''paused:''' | *'''paused:''' a [[boolean]] value representing whether the sound should be paused or not. To pause the sound, use ''true''. | ||
===Returns=== | ===Returns=== | ||
Returns ''true'' if the [[sound]] element was successfully paused, ''false'' otherwise. | Returns ''true'' if the [[sound]] [[element]] was successfully paused, ''false'' otherwise. | ||
==Example== | ==Example== | ||
Line 36: | Line 38: | ||
==See Also== | ==See Also== | ||
{{Client_audio_functions}} | {{Client_audio_functions}} | ||
[[hu:setSoundPaused]] | |||
[[AR:setSoundPaused]] | [[AR:setSoundPaused]] | ||
[[RO:setSoundPaused]] |
Latest revision as of 19:12, 18 July 2019
This function is used to either pause or unpause the playback of the specified sound element.
Use a player element to control a players voice with this function.
Syntax
bool setSoundPaused ( element theSound, bool paused )
OOP Syntax Help! I don't understand this!
- Method: sound:setPaused(...)
- Variable: .paused
- Counterpart: isSoundPaused
Required Arguments
- theSound: the sound element which you want to pause/unpause.
- paused: a boolean value representing whether the sound should be paused or not. To pause the sound, use true.
Returns
Returns true if the sound element was successfully paused, false otherwise.
Example
This example will allow the user to toggle sounds from paused to playing, and from playing to paused
Click to collapse [-]
ClienttheSound = playSound("music/song.mp3", true) function togglePausedSound() if(isSoundPaused(theSound)) then --sound is paused, un-pause it setSoundPaused(theSound, false) else --sound is not paused, pause it setSoundPaused(theSound, true) end end addCommandHandler("pausesound", togglePausedSound)
Changelog
Version | Description |
---|
1.3.2 | Added player element for voice control |
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