SetSoundVolume: Difference between revisions

From Onset Developer Wiki
(Created page with "{{Info|Function|Client|1.0}} {{FuncDescription|__EDIT_ME__}} {{FuncSyntax|SetSoundVolume(sound, volume)}} {{FuncParameters}} {{FuncParam|sound|__EDIT_ME__}} {{FuncParam|vol...")
 
No edit summary
 
(2 intermediate revisions by the same user not shown)
Line 1: Line 1:
{{Info|Function|Client|1.0}}
{{Info|Function|Client|1.0}}


{{FuncDescription|__EDIT_ME__}}
{{FuncDescription|Set the specified sound's volume.}}


{{FuncSyntax|SetSoundVolume(sound, volume)}}
{{FuncSyntax|SetSoundVolume(sound, volume)}}


{{FuncParameters}}
{{FuncParameters}}
{{FuncParam|sound|__EDIT_ME__}}
{{FuncParam|sound|The location of the audio file that you want to stream or the .pls audio stream link.}}
{{FuncParam|volume|__EDIT_ME__}}
{{FuncParam|volume|A float modifier between 0 to 2, where 1 is 100% volume and 2 is the 200% volume.}}


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


== Example ==
== Example ==
__EDIT_ME__
<syntaxhighlight lang="Lua">
local soundId = CreateSound("link")
SetSoundVolume(soundId, 1.0)
</syntaxhighlight>


{{RelatedFunctions}}
{{RelatedFunctions}}
__EDIT_ME__
* [[GetSoundVolume]]
* [[CreateSound]]
* [[DestroySound]]
* [[SetSoundPitch]]
* [[GetSoundPitch]]

Latest revision as of 18:04, 13 January 2020

SetSoundVolume

Type: Function
Context: Client
Introduced: v1.0

Description

Set the specified sound's volume.

Syntax

SetSoundVolume(sound, volume)

Parameters

  • sound
    The location of the audio file that you want to stream or the .pls audio stream link.
  • volume
    A float modifier between 0 to 2, where 1 is 100% volume and 2 is the 200% volume.

Return Value

  • Returns true on success.

Example

local soundId = CreateSound("link")
SetSoundVolume(soundId, 1.0)

See also