Difference between revisions of "Sound:play"

From GiderosMobile
m (Text replacement - "<source" to "<syntaxhighlight")
Line 5: Line 5:
 
=== Description ===
 
=== 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.
 
Creates a new '''SoundChannel''' object to play the sound. By using the returned '''SoundChannel''' object, you can stop the sound and monitor the position.
<source lang="lua">
+
<syntaxhighlight lang="lua">
 
(SoundChannel) = Sound:play(startTime,looping,paused)
 
(SoundChannel) = Sound:play(startTime,looping,paused)
 
</source>
 
</source>

Revision as of 14:30, 13 July 2023

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. <syntaxhighlight lang="lua"> (SoundChannel) = Sound:play(startTime,looping,paused) </source>

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