audio.isChannelActive()

Type Function
Library audio.*
Return value Boolean
Revision 2017.3060
Keywords audio, channel, active
See also audio.play()
audio.pause()

Overview

Returns true if the specified channel is currently playing or paused; false if otherwise.

Syntax

audio.isChannelActive( channel )
channel (required)

Number. The channel you want to know is active or not.

Example

local isChannel1Active = audio.isChannelActive( 1 )
if isChannel1Active then
    audio.stop( 1 )
end