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> === | ||
− | + | 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. | + | |
− | Control of the playing sound is performed through the [[Special:MyLanguage/SoundChannel|SoundChannel]] | + | Control of the playing sound is performed through the [[Special:MyLanguage/SoundChannel|SoundChannel]] object. |
− | object. | + | |
− | |||
=== <translate>Examples</translate> === | === <translate>Examples</translate> === | ||
− | + | <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> === | ||
|} | |} | ||
− | |||
− |
Revision as of 00:03, 10 December 2019
Supported platforms:
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()
MethodsSound.new creates a new Sound object |
EventsConstants |