SoundChannel:setVolume: Difference between revisions

From GiderosMobile
removed language stuff
No edit summary
Line 6: Line 6:
Sets the volume of the sound channel.
Sets the volume of the sound channel.
<source lang="lua">
<source lang="lua">
SoundChannel:setVolume(volume)
SoundChannel:setVolume(volume,balance)
</source>
</source>
=== 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<br/>
'''balance''': (number) the sound channel new balance ('''new Gideros 2022.6''')<br/>


=== Example ===
=== Example ===
Line 15: Line 19:
channel:setVolume(0.5)
channel:setVolume(0.5)
</source>
</source>
=== Parameters ===
'''volume''': (number) 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<br/>


{{SoundChannel}}
{{SoundChannel}}

Revision as of 09:20, 12 March 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)