GetSoundPitch: Difference between revisions

From Onset Developer Wiki
(Created page with "{{Info|Function|Client|1.0}} {{FuncDescription|__EDIT_ME__}} {{FuncSyntax|GetSoundPitch(sound)}} {{FuncParameters}} {{FuncParam|sound|__EDIT_ME__}} {{FuncReturnValue|__EDI...")
 
No edit summary
 
(One intermediate revision by the same user not shown)
Line 1: Line 1:
{{Info|Function|Client|1.0}}
{{Info|Function|Client|1.0}}


{{FuncDescription|__EDIT_ME__}}
{{FuncDescription|Gets the sound pitch.}}


{{FuncSyntax|GetSoundPitch(sound)}}
{{FuncSyntax|GetSoundPitch(sound)}}


{{FuncParameters}}
{{FuncParameters}}
{{FuncParam|sound|__EDIT_ME__}}
{{FuncParam|sound|The sound identifier.}}


{{FuncReturnValue|__EDIT_ME__}}
{{FuncReturnValue|Returns pitch in floating point on success, '''false''' on error.}}


== Example ==
== Example ==
__EDIT_ME__
<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}}
__EDIT_ME__
{{SoundFunctions}}

Latest revision as of 16:32, 11 April 2020

GetSoundPitch

Type: Function
Context: Client
Introduced: v1.0

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

See also