Difference between revisions of "GetSoundPitch"

From Onset Developer Wiki
 
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}}
* [[SetSoundPitch]]
+
{{SoundFunctions}}
* [[GetSoundVolume]]
 
* [[SetSoundVolume]]
 
* [[CreateSound]]
 
* [[DestroySound]]
 

Latest revision as of 18: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