GetSoundPitch: Difference between revisions
From Onset Developer Wiki
No edit summary |
No edit summary |
||
Line 1: | Line 1: | ||
{{Info|Function|Client|1.0}} | {{Info|Function|Client|1.0}} | ||
{{FuncDescription| | {{FuncDescription|Gets the sound pitch.}} | ||
{{FuncSyntax|GetSoundPitch(sound)}} | {{FuncSyntax|GetSoundPitch(sound)}} | ||
{{FuncParameters}} | {{FuncParameters}} | ||
{{FuncParam|sound| | {{FuncParam|sound|The sound identifier.}} | ||
{{FuncReturnValue| | {{FuncReturnValue|Returns pitch in floating point on success, '''false''' on error.}} | ||
== Example == | == Example == | ||
<syntaxhighlight lang='Lua'> | |||
local pitch = GetSoundPitch(soundId) | |||
if (pitch == false) then | |||
-- the sound ID is not valid | |||
else | |||
-- the sound ID pitch is now stored in the variable pitch for use | |||
end | |||
</syntaxhighlight> | |||
{{RelatedFunctions}} | {{RelatedFunctions}} | ||
{{SoundFunctions}} | |||
Latest revision as of 16:32, 11 April 2020
Description
Gets the sound pitch.
Syntax
GetSoundPitch(sound)
Parameters
- sound
The sound identifier.
Return Value
- Returns pitch in floating point on success, false on error.
Example
local pitch = GetSoundPitch(soundId)
if (pitch == false) then
-- the sound ID is not valid
else
-- the sound ID pitch is now stored in the variable pitch for use
end