Difference between revisions of "SoundChannel"

From GiderosMobile
(removed language stuff)
Line 1: Line 1:
 
__NOTOC__
 
__NOTOC__
<languages />
 
 
<!-- GIDEROSOBJ:SoundChannel -->
 
<!-- GIDEROSOBJ:SoundChannel -->
'''<translate>Supported platforms</translate>:''' [[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/>
+
'''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/>
'''<translate>Available since</translate>:''' Gideros 2011.6<br/>
+
'''Available since:''' Gideros 2011.6<br/>
'''<translate>Inherits from</translate>:''' [[Special:MyLanguage/Object|Object]]<br/>
+
'''Inherits from:''' [[Object]]<br/>
  
===<translate>Description</translate>===
+
===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.
  
===<translate>SoundChannel Events</translate>===
+
===SoundChannel Events===
<ul>
+
*''Event.COMPLETE = "complete"'': when the sound channel has finished playing, [[Event.COMPLETE]] event is dispatched
<li><translate>''Event.COMPLETE = "complete"'' When the sound channel has finished playing, [[Special:MyLanguage/Event.COMPLETE|Event.COMPLETE]] event is dispatched.</translate></li>
 
</ul>
 
  
===<translate>Example</translate>===
+
===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;"|
=== <translate>Methods</translate> ===
+
=== Methods ===
[[Special:MyLanguage/SoundChannel:getPitch|SoundChannel:getPitch]] ''<translate>returns the current pitch of the sound channel</translate>''<br/><!-- GIDEROSMTD:SoundChannel:getPitch() returns the current pitch of the sound channel -->
+
[[SoundChannel:getPitch]] ''returns the current pitch of the sound channel''<br/><!--GIDEROSMTD:SoundChannel:getPitch() returns the current pitch of the sound channel-->
[[Special:MyLanguage/SoundChannel:getPosition|SoundChannel:getPosition]] ''<translate>returns the position of the current playback</translate>''<br/><!-- GIDEROSMTD:SoundChannel:getPosition() returns the position of the current playback -->
+
[[SoundChannel:getPosition]] ''returns the position of the current playback''<br/><!--GIDEROSMTD:SoundChannel:getPosition() returns the position of the current playback-->
[[Special:MyLanguage/SoundChannel:getVolume|SoundChannel:getVolume]] ''<translate>returns the current volume of the sound channel</translate>''<br/><!-- GIDEROSMTD:SoundChannel:getVolume() returns the current volume of the sound channel -->
+
[[SoundChannel:getVolume]] ''returns the current volume of the sound channel''<br/><!--GIDEROSMTD:SoundChannel:getVolume() returns the current volume of the sound channel-->
[[Special:MyLanguage/SoundChannel:isLooping|SoundChannel:isLooping]] ''<translate>returns the looping state of the channel</translate>''<br/><!-- GIDEROSMTD:SoundChannel:isLooping() returns the looping state of the channel -->
+
[[SoundChannel:isLooping]] ''returns the looping state of the channel''<br/><!--GIDEROSMTD:SoundChannel:isLooping() returns the looping state of the channel-->
[[Special:MyLanguage/SoundChannel:isPaused|SoundChannel:isPaused]] ''<translate>returns the paused state of the channel</translate>''<br/><!-- GIDEROSMTD:SoundChannel:isPaused() returns the paused state of the channel -->
+
[[SoundChannel:isPaused]] ''returns the paused state of the channel''<br/><!--GIDEROSMTD:SoundChannel:isPaused() returns the paused state of the channel-->
[[Special:MyLanguage/SoundChannel:isPlaying|SoundChannel:isPlaying]] ''<translate>returns the playing state for the sound channel</translate>''<br/><!-- GIDEROSMTD:SoundChannel:isPlaying() returns the playing state for the sound channel -->
+
[[SoundChannel:isPlaying]] ''returns the playing state for the sound channel''<br/><!--GIDEROSMTD:SoundChannel:isPlaying() returns the playing state for the sound channel-->
[[Special:MyLanguage/SoundChannel:setLooping|SoundChannel:setLooping]] ''<translate>sets the looping state of the channel</translate>''<br/><!-- GIDEROSMTD:SoundChannel:setLooping(looping) sets the looping state of the channel -->
+
[[SoundChannel:setLooping]] ''sets the looping state of the channel''<br/><!--GIDEROSMTD:SoundChannel:setLooping(looping) sets the looping state of the channel-->
[[Special:MyLanguage/SoundChannel:setPaused|SoundChannel:setPaused]] ''<translate>sets the paused state of the channel</translate>''<br/><!-- GIDEROSMTD:SoundChannel:setPaused(paused) sets the paused 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-->
[[Special:MyLanguage/SoundChannel:setPitch|SoundChannel:setPitch]] ''<translate>sets the pitch of the sound channel</translate>''<br/><!-- GIDEROSMTD:SoundChannel:setPitch(pitch) sets the pitch of the sound channel -->
+
[[SoundChannel:setPitch]] ''sets the pitch of the sound channel''<br/><!--GIDEROSMTD:SoundChannel:setPitch(pitch) sets the pitch of the sound channel-->
[[Special:MyLanguage/SoundChannel:setPosition|SoundChannel:setPosition]] ''<translate>sets the position of the current playback</translate>''<br/><!-- GIDEROSMTD:SoundChannel:setPosition(position) sets the position of the current playback -->
+
[[SoundChannel:setPosition]] ''sets the position of the current playback''<br/><!--GIDEROSMTD:SoundChannel:setPosition(position) sets the position of the current playback-->
[[Special:MyLanguage/SoundChannel:setVolume|SoundChannel:setVolume]] ''<translate>sets the volume of the sound channel</translate>''<br/><!-- GIDEROSMTD:SoundChannel:setVolume(volume) sets the volume of the sound channel -->
+
[[SoundChannel:setVolume]] ''sets the volume of the sound channel''<br/><!--GIDEROSMTD:SoundChannel:setVolume(volume) sets the volume of the sound channel-->
[[Special:MyLanguage/SoundChannel:setWorldPosition|SoundChannel:setWorldPosition]] <br/><!-- GIDEROSMTD:SoundChannel:setWorldPosition(x,y,z,vx,vy,vz) -->
+
[[SoundChannel:setWorldPosition]] '''''wip'''''<br/><!--GIDEROSMTD:SoundChannel:setWorldPosition(x,y,z,vx,vy,vz) wip-->
[[Special:MyLanguage/SoundChannel:stop|SoundChannel:stop]] ''<translate>stops the sound playing in the channel</translate>''<br/><!-- GIDEROSMTD:SoundChannel:stop() stops the sound playing in the channel -->
+
[[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;"|
=== <translate>Events</translate> ===
+
=== Events ===
<!--[[Special:MyLanguage/Event.COMPLETE|Event.COMPLETE]]<br/>-->
+
<!--[[Event.COMPLETE]]<br/>-->
[[Special:MyLanguage/SoundChannel_Event.COMPLETE|SoundChannel_Event.COMPLETE]]<br/>
+
[[SoundChannel_Event.COMPLETE]]<br/><!--GIDEROSEVT:Event.COMPLETE complete-->
<!-- GIDEROSEVT:Event.COMPLETE complete-->
+
=== Constants ===
=== <translate>Constants</translate> ===
 
 
|}
 
|}
  
 
{{GIDEROS IMPORTANT LINKS}}
 
{{GIDEROS IMPORTANT LINKS}}

Revision as of 07:50, 29 May 2021

Supported platforms: Platform android.pngPlatform ios.pngPlatform mac.pngPlatform pc.pngPlatform html5.pngPlatform winrt.pngPlatform win32.png
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)

Methods

SoundChannel:getPitch returns the current pitch of the sound channel
SoundChannel:getPosition returns the position of the current playback
SoundChannel:getVolume returns the current volume of the sound channel
SoundChannel:isLooping returns the looping state of the channel
SoundChannel:isPaused returns the paused state of the channel
SoundChannel:isPlaying returns the playing state for the sound channel
SoundChannel:setLooping sets the looping state of the channel
SoundChannel:setPaused sets the paused state of the channel
SoundChannel:setPitch sets the pitch of the sound channel
SoundChannel:setPosition sets the position of the current playback
SoundChannel:setVolume sets the volume of the sound channel
SoundChannel:setWorldPosition wip
SoundChannel:stop stops the sound playing in the channel

Events

SoundChannel_Event.COMPLETE

Constants