We have the ability to control our sounds, now that we can play them in the simulator. If you think back to the days of cassette tape players, it had the ability to use functions such as pause, stop, and rewind. Corona's audio API library can do just that.
The audio.stop()
function stops playback on a channel and clears the channel, so it can be played on again.
The syntax is audio.stop( [channel] )
or audio.stop( [ { channel = c } ] )
.
Having no parameters stops all active channels. The channel
parameter specifies the channel to stop. Specifying 0 stops all channels.
The audio.pause()
function pauses playback on a channel. This has no effect on channels that aren't playing.
The syntax is audio.pause( [channel] )
or audio.pause( [ {channel = c} ] )
.
Having no parameters pauses all active channels. The channel
parameter specifies the channel to pause. Specifying 0 pauses all channels.