Sound:play: Difference between revisions

From GiderosMobile
No edit summary
Pie (talk | contribs)
m linked Sound Channel page
 
(15 intermediate revisions by 2 users not shown)
Line 1: Line 1:
__NOTOC__
__NOTOC__
'''Available since:''' Gideros 2011.6<br/>
'''Available since:''' Gideros 2011.6<br/>
'''Class:''' [[Sound]]<br/>
=== Description ===
=== Description ===
<br />
Creates a new '''[[SoundChannel]]''' object to play the sound. By using the returned '''SoundChannel''' object, you can stop the sound and monitor the position.
Creates a new `SoundChannel` object to play the sound. By using the retured `SoundChannel` object,<br />
<syntaxhighlight lang="lua">
you can stop the sound and monitor the position.<br />
<br />
<source lang="lua">
(SoundChannel) = Sound:play(startTime,looping,paused)
(SoundChannel) = Sound:play(startTime,looping,paused)
</source>
</syntaxhighlight>
'''startTime''': (number, default = 0) The initial position in milliseconds at which playback should start. ''''''<br/>
 
'''looping''': (boolean, default = false)  ''''''<br/>
=== Parameters ===
'''paused''': (boolean, default = false)  ''''''<br/>
'''startTime''': (number, default = 0) the initial position in milliseconds at which playback should start<br/>
'''Returns''' (SoundChannel) A `SoundChannel` object, which you use to control the sound. This function returns `nil` if you run out of available sound channels.<br/>
'''looping''': (boolean, default = false)  <br/>
'''paused''': (boolean, default = false)  <br/>
 
=== Return values ===
'''Returns''' (SoundChannel) a SoundChannel object which you use to control the sound. This function returns ''nil'' if you run out of available sound channels<br/>
 
{{Sound}}

Latest revision as of 18:32, 7 January 2024

Available since: Gideros 2011.6
Class: Sound

Description

Creates a new SoundChannel object to play the sound. By using the returned SoundChannel object, you can stop the sound and monitor the position.

(SoundChannel) = Sound:play(startTime,looping,paused)

Parameters

startTime: (number, default = 0) the initial position in milliseconds at which playback should start
looping: (boolean, default = false)
paused: (boolean, default = false)

Return values

Returns (SoundChannel) a SoundChannel object which you use to control the sound. This function returns nil if you run out of available sound channels