SetSoundPan: Difference between revisions
Jump to navigation
Jump to search
(Created page with "__NOTOC__ {{Client function}} This function is used to change the pan level of the specified sound element. ==Syntax== <syntaxhighlight lang="lua">bool setSoundPan ( element theSound, fl...") |
No edit summary |
||
Line 7: | Line 7: | ||
===Required Arguments=== | ===Required Arguments=== | ||
*'''theSound:''' The [[sound]] element which | *'''theSound:''' The [[sound]] element which pan you want to modify. | ||
*'''pan:''' A [[float|floating]] point number representing the desired pan level. Range is from '' | *'''pan:''' A [[float|floating]] point number representing the desired pan level. Range is from ''-1.0 (left)'' to ''1.0 (right)'' | ||
===Returns=== | ===Returns=== | ||
Line 19: | Line 19: | ||
local left = playSFX("genrl", 75, 6, true) -- Play loading theme music | local left = playSFX("genrl", 75, 6, true) -- Play loading theme music | ||
local right = playSFX("genrl", 75, 7, true) | local right = playSFX("genrl", 75, 7, true) | ||
setSoundPan(left, | setSoundPan(left, -1) -- switch the first music to left channel | ||
setSoundPan(right, 1) -- switch the second music to right channel | setSoundPan(right, 1) -- switch the second music to right channel | ||
end | end |
Revision as of 12:08, 27 August 2013
This function is used to change the pan level of the specified sound element.
Syntax
bool setSoundPan ( element theSound, float pan )
Required Arguments
- theSound: The sound element which pan you want to modify.
- pan: A floating point number representing the desired pan level. Range is from -1.0 (left) to 1.0 (right)
Returns
Returns true if the sound element pan was successfully changed, false otherwise.
Example
Click to collapse [-]
Clientfunction playMusic () local left = playSFX("genrl", 75, 6, true) -- Play loading theme music local right = playSFX("genrl", 75, 7, true) setSoundPan(left, -1) -- switch the first music to left channel setSoundPan(right, 1) -- switch the second music to right channel end addCommandHandler("music", playMusic) -- add the command handler
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