Difference between revisions of "Sound"

From GiderosMobile
Line 5: Line 5:
 
'''<translate>Available since</translate>:''' Gideros 2011.6<br/>
 
'''<translate>Available since</translate>:''' Gideros 2011.6<br/>
 
'''<translate>Inherits from</translate>:''' [[Special:MyLanguage/Object|Object]]<br/>
 
'''<translate>Inherits from</translate>:''' [[Special:MyLanguage/Object|Object]]<br/>
 +
 
=== <translate>Description</translate> ===
 
=== <translate>Description</translate> ===
<translate><br />
+
The [[Special:MyLanguage/Sound|Sound]] class lets you load and play WAV, MP3, MOD, XM, S3M and IT sound files.
The [[Special:MyLanguage/Sound|Sound]] class lets you load and play WAV, MP3, MOD, XM, S3M and IT sound files.<br />
+
 
Control of the playing sound is performed through the [[Special:MyLanguage/SoundChannel|SoundChannel]]<br />
+
Control of the playing sound is performed through the [[Special:MyLanguage/SoundChannel|SoundChannel]] object.
object.<br />
+
 
<br /></translate>
 
 
=== <translate>Examples</translate> ===
 
=== <translate>Examples</translate> ===
'''Example'''<br/>
+
<source lang="lua">
<source lang="lua">local sound = Sound.new("music.mp3")
+
local sound = Sound.new("music.mp3")
 
 
 
local channel = sound:play()
 
local channel = sound:play()
  
 
-- after some time --
 
-- after some time --
channel:stop()</source>
+
channel:stop()
 +
</source>
 +
 
 
{|-
 
{|-
 
| style="width: 50%; vertical-align:top;"|
 
| style="width: 50%; vertical-align:top;"|
Line 26: Line 27:
 
[[Special:MyLanguage/Sound:getLength|Sound:getLength]] <br/><!-- GIDEROSMTD:Sound:getLength()  -->
 
[[Special:MyLanguage/Sound:getLength|Sound:getLength]] <br/><!-- GIDEROSMTD:Sound:getLength()  -->
 
[[Special:MyLanguage/Sound:play|Sound:play]] ''<translate>creates a new SoundChannel object to play the sound</translate>''<br/><!-- GIDEROSMTD:Sound:play(startTime,looping,paused) creates a new SoundChannel object to play the sound -->
 
[[Special:MyLanguage/Sound:play|Sound:play]] ''<translate>creates a new SoundChannel object to play the sound</translate>''<br/><!-- GIDEROSMTD:Sound:play(startTime,looping,paused) creates a new SoundChannel object to play the sound -->
 +
 
| style="width: 50%; vertical-align:top;"|
 
| style="width: 50%; vertical-align:top;"|
 
=== <translate>Events</translate> ===
 
=== <translate>Events</translate> ===
 
=== <translate>Constants</translate> ===
 
=== <translate>Constants</translate> ===
 
|}
 
|}
 
{{Sound}}
 

Revision as of 01:03, 10 December 2019


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 Sound class lets you load and play WAV, MP3, MOD, XM, S3M and IT sound files.

Control of the playing sound is performed through the SoundChannel object.

Examples

local sound = Sound.new("music.mp3")
local channel = sound:play()

-- after some time --
channel:stop()

Methods

Sound.new creates a new Sound object
Sound.setListenerPosition
Sound:getLength
Sound:play creates a new SoundChannel object to play the sound

Events

Constants