audio.isChannelPlaying()

Type Function
Library audio.*
Return value Boolean
Revision 2017.3145
Keywords audio, play
See also audio.isChannelActive()
audio.pause()
audio.play()

Overview

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

Syntax

audio.isChannelPlaying( channel )
channel (required)

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

Example

local isChannel1Playing = audio.isChannelPlaying( 1 )
if isChannel1Playing then
    audio.pause( 1 )
end