GetSoundPan: Difference between revisions

From Multi Theft Auto: Wiki
Jump to navigation Jump to search
m (Reverted edits by Ameir (talk) to last revision by Alvesvin)
Tag: Rollback
 
(3 intermediate revisions by 3 users not shown)
Line 17: Line 17:
function playMusic()
function playMusic()
     local song = playSound("song.mp3")
     local song = playSound("song.mp3")
     setSoundPan(song, 0.3)
     setSoundPan(song, -1)
     outputChatBox("Current pan is " .. getSoundPan(song))
     outputChatBox("Current pan is " .. getSoundPan(song))
end
end
Line 27: Line 27:
{{Client_audio_functions}}
{{Client_audio_functions}}


[[AR:getSoundPan]]
[[HU: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 [-]
Client
function playMusic()
    local song = playSound("song.mp3")
    setSoundPan(song, -1)
    outputChatBox("Current pan is " .. getSoundPan(song))
end
addCommandHandler("music", playMusic)

See Also