SoundChannel:setVolume: Difference between revisions
From GiderosMobile
No edit summary |
m Text replacement - "</source>" to "</syntaxhighlight>" |
||
| (One intermediate revision by the same user not shown) | |||
| Line 5: | Line 5: | ||
=== Description === | === Description === | ||
Sets the volume of the sound channel. | Sets the volume of the sound channel. | ||
< | <syntaxhighlight lang="lua"> | ||
SoundChannel:setVolume(volume,balance) | SoundChannel:setVolume(volume,balance) | ||
</ | </syntaxhighlight> | ||
=== Parameters === | === Parameters === | ||
| Line 14: | Line 14: | ||
=== Example === | === Example === | ||
< | <syntaxhighlight lang="lua"> | ||
local bulletsnd = Sound.new("audio/shoot.wav") | local bulletsnd = Sound.new("audio/shoot.wav") | ||
local channel = bulletsnd:play() | local channel = bulletsnd:play() | ||
channel:setVolume(0.5) | channel:setVolume(0.5) | ||
</ | </syntaxhighlight> | ||
{{SoundChannel}} | {{SoundChannel}} | ||
Latest revision as of 13: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)
- SoundChannel:getPitch
- SoundChannel:getPosition
- SoundChannel:getStreamId
- SoundChannel:getVolume
- SoundChannel:isLooping
- SoundChannel:isPaused
- SoundChannel:isPlaying
- SoundChannel:setEffect
- SoundChannel:setLooping
- SoundChannel:setPaused
- SoundChannel:setPitch
- SoundChannel:setPosition
- SoundChannel:setVolume
- SoundChannel:setWorldPosition
- SoundChannel:stop