Difference between revisions of "SoundChannel"
(removed language stuff) |
|||
Line 1: | Line 1: | ||
__NOTOC__ | __NOTOC__ | ||
− | |||
<!-- GIDEROSOBJ:SoundChannel --> | <!-- GIDEROSOBJ:SoundChannel --> | ||
− | ''' | + | '''Supported platforms:''' [[File:Platform android.png]][[File:Platform ios.png]][[File:Platform mac.png]][[File:Platform pc.png]][[File:Platform html5.png]][[File:Platform winrt.png]][[File:Platform win32.png]]<br/> |
− | ''' | + | '''Available since:''' Gideros 2011.6<br/> |
− | ''' | + | '''Inherits from:''' [[Object]]<br/> |
− | === | + | ===Description=== |
The '''SoundChannel''' class is used to control and monitor a playing sound. | 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=== |
<source lang="lua"> | <source lang="lua"> | ||
local sound1 = Sound.new("audio/sound1.ogg") | local sound1 = Sound.new("audio/sound1.ogg") | ||
Line 27: | Line 24: | ||
{|- | {|- | ||
| style="width: 50%; vertical-align:top;"| | | style="width: 50%; vertical-align:top;"| | ||
− | === | + | === Methods === |
− | [[ | + | [[SoundChannel:getPitch]] ''returns the current pitch of the sound channel''<br/><!--GIDEROSMTD:SoundChannel:getPitch() returns the current pitch of the sound channel--> |
− | [[ | + | [[SoundChannel:getPosition]] ''returns the position of the current playback''<br/><!--GIDEROSMTD:SoundChannel:getPosition() returns the position of the current playback--> |
− | [[ | + | [[SoundChannel:getVolume]] ''returns the current volume of the sound channel''<br/><!--GIDEROSMTD:SoundChannel:getVolume() returns the current volume of the sound channel--> |
− | [[ | + | [[SoundChannel:isLooping]] ''returns the looping state of the channel''<br/><!--GIDEROSMTD:SoundChannel:isLooping() returns the looping state of the channel--> |
− | [[ | + | [[SoundChannel:isPaused]] ''returns the paused state of the channel''<br/><!--GIDEROSMTD:SoundChannel:isPaused() returns the paused state of the channel--> |
− | [[ | + | [[SoundChannel:isPlaying]] ''returns the playing state for the sound channel''<br/><!--GIDEROSMTD:SoundChannel:isPlaying() returns the playing state for the sound channel--> |
− | [[ | + | [[SoundChannel:setLooping]] ''sets the looping state of the channel''<br/><!--GIDEROSMTD:SoundChannel:setLooping(looping) sets the looping state of the channel--> |
− | [[ | + | [[SoundChannel:setPaused]] ''sets the paused state of the channel''<br/><!--GIDEROSMTD:SoundChannel:setPaused(paused) sets the paused state of the channel--> |
− | [[ | + | [[SoundChannel:setPitch]] ''sets the pitch of the sound channel''<br/><!--GIDEROSMTD:SoundChannel:setPitch(pitch) sets the pitch of the sound channel--> |
− | [[ | + | [[SoundChannel:setPosition]] ''sets the position of the current playback''<br/><!--GIDEROSMTD:SoundChannel:setPosition(position) sets the position of the current playback--> |
− | [[ | + | [[SoundChannel:setVolume]] ''sets the volume of the sound channel''<br/><!--GIDEROSMTD:SoundChannel:setVolume(volume) sets the volume of the sound channel--> |
− | [[ | + | [[SoundChannel:setWorldPosition]] '''''wip'''''<br/><!--GIDEROSMTD:SoundChannel:setWorldPosition(x,y,z,vx,vy,vz) wip--> |
− | [[ | + | [[SoundChannel:stop]] ''stops the sound playing in the channel''<br/><!--GIDEROSMTD:SoundChannel:stop() stops the sound playing in the channel--> |
| style="width: 50%; vertical-align:top;"| | | style="width: 50%; vertical-align:top;"| | ||
− | === | + | === Events === |
− | <!--[[ | + | <!--[[Event.COMPLETE]]<br/>--> |
− | [[ | + | [[SoundChannel_Event.COMPLETE]]<br/><!--GIDEROSEVT:Event.COMPLETE complete--> |
− | <!-- GIDEROSEVT:Event.COMPLETE complete--> | + | === Constants === |
− | === | ||
|} | |} | ||
{{GIDEROS IMPORTANT LINKS}} | {{GIDEROS IMPORTANT LINKS}} |
Revision as of 06:50, 29 May 2021
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)
MethodsSoundChannel:getPitch returns the current pitch of the sound channel |
EventsConstants |