SoundChannel:setVolume: Difference between revisions

From GiderosMobile
added example
No edit summary
Line 23: Line 23:
'''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>
'''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/>
<br/>
<br/>
 
{{SoundChannel}}

Revision as of 22:53, 3 December 2019



Available since: Gideros 2011.6
Class: SoundChannel

Description

Sets the volume of the sound channel.

 SoundChannel:setVolume(volume)

Example

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

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.