Sound.play

Plays this sound in the selected channel.

class Sound
int
play
(
int loops = 0
,
int channel = -1
,
int maxTicks = -1
)

Parameters

loops int

-1 loops will play forever. 0 plays once.

channel int

-1 loops will choose the first free unreserved channel.

maxTicks int

Maximum milliseconds to play this sound. If not enough loops or the sample chunk is not long enough, then the sample may stop before this timeout occurs. -1 means play forever.

Return Value

Type: int

the channel the sample is played on. On any errors, -1 is returned.

Meta