SetSoundPitch: Difference between revisions

From Onset Developer Wiki
28days (talk | contribs)
No edit summary
28days (talk | contribs)
No edit summary
Line 1: Line 1:
{{Info|Function|Client|1.0}}
{{Info|Function|Client|1.0}}


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


{{FuncSyntax|SetSoundPitch(sound, Pitch)}}
{{FuncSyntax|SetSoundPitch(sound, Pitch)}}


{{FuncParameters}}
{{FuncParameters}}
{{FuncParam|sound|__EDIT_ME__}}
{{FuncParam|sound|The sound identifier.}}
{{FuncParam|Pitch|__EDIT_ME__}}
{{FuncParam|Pitch|The pitch in floating point.}}


{{FuncReturnValue|__EDIT_ME__}}
{{FuncReturnValue|Returns '''true''' on success.}}


== Example ==
== Example ==
__EDIT_ME__
<syntaxhighlight lang='Lua'>
if (IsValidSound(soundId)) then
        SetSoundPitch(soundId, 0.5) -- Half the sound pitch
end
</syntaxhighlight>


{{RelatedFunctions}}
{{RelatedFunctions}}
* [[GetSoundVolume]]
{{SoundFunctions}}
* [[SetSoundVolume]]
* [[CreateSound]]
* [[DestroySound]]
* [[GetSoundPitch]]

Revision as of 16:29, 11 April 2020

SetSoundPitch

Type: Function
Context: Client
Introduced: v1.0

Description

Sets the sound pitch.

Syntax

SetSoundPitch(sound, Pitch)

Parameters

  • sound
    The sound identifier.
  • Pitch
    The pitch in floating point.

Return Value

  • Returns true on success.

Example

if (IsValidSound(soundId)) then
        SetSoundPitch(soundId, 0.5) -- Half the sound pitch
end

See also