Difference between revisions of "SoundChannel:setVolume"

From GiderosMobile
(added example)
Line 1: Line 1:
 
__NOTOC__
 
__NOTOC__
 +
 
<languages />
 
<languages />
 +
 
'''<translate>Available since</translate>:''' Gideros 2011.6<br/>
 
'''<translate>Available since</translate>:''' Gideros 2011.6<br/>
 
'''<translate>Class</translate>:''' [[Special:MyLanguage/SoundChannel|SoundChannel]]<br/>
 
'''<translate>Class</translate>:''' [[Special:MyLanguage/SoundChannel|SoundChannel]]<br/>
 +
 
=== <translate>Description</translate> ===
 
=== <translate>Description</translate> ===
<translate><br />
+
<translate>Sets the volume of the sound channel.</translate>
Sets the volume of the sound channel.<br />
+
<br/>
<br /></translate>
 
 
<source lang="lua">
 
<source lang="lua">
 
  SoundChannel:setVolume(volume)
 
  SoundChannel:setVolume(volume)
 
</source>
 
</source>
 +
 +
=== <translate>Example</translate> ===
 +
<source lang="lua">
 +
local bulletsnd = Sound.new("audio/shoot.wav")
 +
local channel = bulletsnd:play()
 +
channel:setVolume(0.5)
 +
</source>
 +
<br/>
 +
 
=== <translate>Parameters</translate> ===
 
=== <translate>Parameters</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/>
+
'''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/>

Revision as of 08:27, 15 November 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.