Difference between revisions of "SoundChannel:setVolume"

From GiderosMobile
m (Text replacement - "</source>" to "</syntaxhighlight>")
 
(7 intermediate revisions by 2 users not shown)
Line 1: Line 1:
 
__NOTOC__
 
__NOTOC__
'''<translate>Available since</translate>:''' Gideros 2011.6<br/>
+
'''Available since:''' Gideros 2011.6<br/>
'''<translate>Class</translate>:''' [[Special:MyLanguage/SoundChannel|SoundChannel]]<br/>
+
'''Class:''' [[SoundChannel]]<br/>
=== <translate>Description</translate> ===
+
 
<translate><br />
+
=== Description ===
Sets the volume of the sound channel.<br />
+
Sets the volume of the sound channel.
<br /></translate>
+
<syntaxhighlight lang="lua">
<source lang="lua">
+
SoundChannel:setVolume(volume,balance)
SoundChannel:setVolume(volume)
+
</syntaxhighlight>
</source>
+
 
=== <translate>Parameters</translate> ===
+
=== Parameters ===
'''volume''': (number) <translate>The new volume of the sound channel. Valid range of this parameter is between 0.0 and 1.0, where 1.0 is the maximum volume value.</translate> <br/>
+
'''volume''': (number) the sound channel new volume. Valid range of this parameter is between 0.0 and 1.0, where 1.0 is the maximum volume value<br/>
 +
'''balance''': (number) the sound channel new balance ('''new Gideros 2022.6''')<br/>
 +
 
 +
=== Example ===
 +
<syntaxhighlight lang="lua">
 +
local bulletsnd = Sound.new("audio/shoot.wav")
 +
local channel = bulletsnd:play()
 +
channel:setVolume(0.5)
 +
</syntaxhighlight>
 +
 
 +
{{SoundChannel}}

Latest revision as of 15:33, 13 July 2023

Available since: Gideros 2011.6
Class: SoundChannel

Description

Sets the volume of the sound channel.

SoundChannel:setVolume(volume,balance)

Parameters

volume: (number) the sound channel new volume. Valid range of this parameter is between 0.0 and 1.0, where 1.0 is the maximum volume value
balance: (number) the sound channel new balance (new Gideros 2022.6)

Example

local bulletsnd = Sound.new("audio/shoot.wav")
local channel = bulletsnd:play()
channel:setVolume(0.5)