Difference between revisions of "SoundChannel"
m (Text replacement - "</source>" to "</syntaxhighlight>") |
|||
(2 intermediate revisions by 2 users not shown) | |||
Line 12: | Line 12: | ||
===Example=== | ===Example=== | ||
− | < | + | <syntaxhighlight lang="lua"> |
local sound1 = Sound.new("audio/sound1.ogg") | local sound1 = Sound.new("audio/sound1.ogg") | ||
local audio1 = sound1:play() | local audio1 = sound1:play() | ||
Line 20: | Line 20: | ||
local audio2 = sound2:play() | local audio2 = sound2:play() | ||
end) | end) | ||
− | </ | + | </syntaxhighlight> |
=== See also === | === See also === | ||
+ | '''[[Sound]]'''<br/> | ||
'''[[Playing_Sound_and_Music]]''' | '''[[Playing_Sound_and_Music]]''' | ||
Latest revision as of 14:32, 13 July 2023
Supported platforms:
Available since: Gideros 2011.6
Inherits from: Object
Description
The SoundChannel class is used to control and monitor a playing sound.
SoundChannel Events
- Event.COMPLETE = "complete": when the sound channel has finished playing, Event.COMPLETE event is dispatched
Example
local sound1 = Sound.new("audio/sound1.ogg")
local audio1 = sound1:play()
audio1:addEventListener(Event.COMPLETE, function()
-- play a second audio when the first one is complete
local sound2 = Sound.new("audio/sound2.ogg")
local audio2 = sound2:play()
end)
See also
MethodsSoundChannel:getPitch returns the current sound channel pitch |
EventsConstants |