IsSoundPanningEnabled: Difference between revisions
Jump to navigation
Jump to search
mNo edit summary |
Fernando187 (talk | contribs) (Remove obsolete Requirements section) |
||
(5 intermediate revisions by 3 users not shown) | |||
Line 4: | Line 4: | ||
This function checks whether panning is enabled in a [[sound]] [[element]] or not. | This function checks whether panning is enabled in a [[sound]] [[element]] or not. | ||
}} | }} | ||
{{Tip| | {{Tip|Although this function works in no-3D sounds (those created by [[playSound]]), it only makes sense to use it with 3D sounds (created by [[playSound3D]]). Please refer to [[setSoundPanningEnabled]] for a explanation of what this property does.}} | ||
==Syntax== | ==Syntax== | ||
Line 32: | Line 32: | ||
addEventHandler("onClientResourceStart", resourceRoot, testPanning) | addEventHandler("onClientResourceStart", resourceRoot, testPanning) | ||
</syntaxhighlight> | </syntaxhighlight> | ||
==See Also== | ==See Also== | ||
{{Client_audio_functions}} | {{Client_audio_functions}} | ||
[[hu:isSoundPanningEnabled]] | |||
[[ar:isSoundPanningEnabled]] | |||
[[pt-br:isSoundPanningEnabled]] |
Latest revision as of 17:11, 7 November 2024
This function checks whether panning is enabled in a sound element or not.
Tip: Although this function works in no-3D sounds (those created by playSound), it only makes sense to use it with 3D sounds (created by playSound3D). Please refer to setSoundPanningEnabled for a explanation of what this property does. |
Syntax
bool isSoundPanningEnabled ( element theSound )
OOP Syntax Help! I don't understand this!
- Method: sound:isPanningEnabled(...)
- Variable: .panningEnabled
- Counterpart: setSoundPanningEnabled
Required Arguments
Returns
Returns true if the sound is valid and it has panning enabled, false if it does not or is not valid.
Example
This example plays a xy.mp3 file in the root folder of the resource which contains it at the center of the map, and proves that by default a sound enables panning by outputting the result of this function to the chatbox right after creating it. Then it disables the panning of the sound.
local function testPanning() -- Create the sound and output the panning property state local sound = playSound3D("xy.mp3", 0, 0, 0) outputChatBox("By default, the sound has its panning " .. (isSoundPanningEnabled(sound) and "enabled" or "disabled")) -- Disable the panning and ouput a fact setSoundPanningEnabled(sound, false) outputChatBox("The sound panning was disabled, so it won't annoy you when the camera it's in a side anymore!", 0, 255, 0) end addEventHandler("onClientResourceStart", resourceRoot, testPanning)
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