audio.resume()

Type Function
Library audio.*
Return value Number
Revision 2017.3060
Keywords audio, resume, pause
See also audio.pause()
audio.play()

Overview

Resumes playback on a channel that is paused (or all channels if no channel is specified). Should have no effect on channels that aren't paused.

This function returns the number of channels actually resumed or -1 on error.

Syntax

audio.resume( [channel] )
channel (optional)

Number. The channel to resume. Specifying 0 (or nothing) resumes all channels.

Example

local backgroundMusicChannel = audio.play( backgroundMusic, { loops=-1 }  ) 
local audio.pause( backgroundMusicChannel )

-- resume after 3 seconds
timer.performWithDelay( 3000, function()

    audio.resume( backgroundMusicChannel )

end, 1 )