Type Function Library audio.* Return value Number Revision 2017.3060 Keywords audio, pause, sound See also audio.play() audio.resume()
Pauses playback on a channel (or all channels if no channels are specified). Has no effect on channels that aren't playing.
This function returns the number of channels actually paused or -1
on error.
audio.pause( [channel] )
Number. The channel to pause. Specifying 0
pauses all channels. If channel
is omitted, audio.pause()
will pause all active channels.
local backgroundMusicChannel = audio.play( backgroundMusic, { loops=-1 } ) audio.pause( backgroundMusicChannel )