GetSoundPan: Difference between revisions
Jump to navigation
Jump to search
Tag: Rollback |
|||
(6 intermediate revisions by 6 users not shown) | |||
Line 5: | Line 5: | ||
==Syntax== | ==Syntax== | ||
<syntaxhighlight lang="lua">float getSoundPan ( element theSound )</syntaxhighlight> | <syntaxhighlight lang="lua">float getSoundPan ( element theSound )</syntaxhighlight> | ||
{{OOP||[[sound]]:getPan|pan|setSoundPan}} | |||
===Required Arguments=== | ===Required Arguments=== | ||
*'''theSound:''' | *'''theSound:''' the [[sound]] element which pan you want to get. | ||
===Returns=== | ===Returns=== | ||
Line 15: | Line 15: | ||
<section name="Client" class="client" show="true"> | <section name="Client" class="client" show="true"> | ||
<syntaxhighlight lang="lua"> | <syntaxhighlight lang="lua"> | ||
function playMusic () | function playMusic() | ||
local song = playSound("song.mp3") | |||
setSoundPan(song, -1) | |||
outputChatBox("Current pan is " .. getSoundPan(song)) | |||
end | end | ||
addCommandHandler("music", playMusic) | addCommandHandler("music", playMusic) | ||
</syntaxhighlight> | </syntaxhighlight> | ||
Line 27: | Line 26: | ||
==See Also== | ==See Also== | ||
{{Client_audio_functions}} | {{Client_audio_functions}} | ||
[[AR:getSoundPan]] | |||
[[HU:getSoundPan]] | |||
[[PT-BR:getSoundPan]] |
Latest revision as of 16:36, 26 September 2021
This function is used to get the pan level of the specified sound element.
Syntax
float getSoundPan ( element theSound )
OOP Syntax Help! I don't understand this!
- Method: sound:getPan(...)
- Variable: .pan
- Counterpart: setSoundPan
Required Arguments
- theSound: the sound element which pan you want to get.
Returns
Returns float value with range from -1.0 (left) to 1.0 (right), false otherwise.
Example
Click to collapse [-]
Clientfunction playMusic() local song = playSound("song.mp3") setSoundPan(song, -1) outputChatBox("Current pan is " .. getSoundPan(song)) end addCommandHandler("music", playMusic)
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