SetSoundVolume: Difference between revisions
From Onset Developer Wiki
No edit summary |
No edit summary |
||
(One intermediate revision by the same user not shown) | |||
Line 9: | Line 9: | ||
{{FuncParam|volume|A float modifier between 0 to 2, where 1 is 100% volume and 2 is the 200% volume.}} | {{FuncParam|volume|A float modifier between 0 to 2, where 1 is 100% volume and 2 is the 200% volume.}} | ||
{{FuncReturnValue| | {{FuncReturnValue|Returns '''true''' on success.}} | ||
== Example == | == Example == | ||
<syntaxhighlight lang="Lua"> | |||
local soundId = CreateSound("link") | |||
SetSoundVolume(soundId, 1.0) | |||
</syntaxhighlight> | |||
{{RelatedFunctions}} | {{RelatedFunctions}} | ||
* [[GetSoundVolume]] | |||
* [[CreateSound]] | |||
* [[DestroySound]] | |||
* [[SetSoundPitch]] | |||
* [[GetSoundPitch]] |
Latest revision as of 18:04, 13 January 2020
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)