stopSound
Client-side
Server-side
Shared
Stops the sound playback for specified sound element. The sound element is also destroyed.
OOP Syntax Help! I don't understand this!
- Method: sound:stop(...)
Syntax
bool stopSound ( sound theSound )
Required Arguments
- theSound: The sound element you want to stop playing.
Returns
- bool: result
Returns true if the sound was successfully stopped, false otherwise.
Code Examples
client
function startMySound() sound = playSound( "sound.mp3", true )endaddEventHandler( "onClientResourceStart", resourceRoot, startMySound )
function stopMySound() stopSound( sound )endaddCommandHandler ( "stopsound", stopMySound ) --using the command 'stopsound' will stop the sound
See Also
Audio Functions
- getRadioChannelName
- getRadioChannel
- getSoundBPM
- getSFXStatus
- getSoundBufferLength
- getSoundEffectParameters
- getSoundEffects
- getSoundFFTData
- getSoundLevelData
- getSoundLength
- getSoundMetaTags
- getSoundMaxDistance
- getSoundMinDistance
- getSoundPan
- getSoundPosition
- getSoundProperties
- getSoundSpeed
- getSoundVolume
- getSoundWaveData
- isSoundLooped
- isSoundPanningEnabled
- isSoundPaused
- playSFX
- playSFX3D
- playSound
- playSound3D
- setRadioChannel
- setSoundEffectEnabled
- setSoundEffectParameter
- setSoundMaxDistance
- setSoundLooped
- setSoundMinDistance
- setSoundPan
- setSoundPanningEnabled
- setSoundPaused
- setSoundPosition
- setSoundProperties
- setSoundSpeed
- setSoundVolume
- stopSound