self:is_playing

Client

Checks whether the audio-2d instance is currently playing


Syntax

local result = self:is_playing()

Parameters

No parameters are accepted by this function

Returns

TypeNameDescription
boolresulttrue if audio is currently playing, false otherwise

Examples

Check playback state before starting
local entity = core.audio_2d.create("sounds/ambient.ogg")

if not entity:is_playing() then
    entity:play()
end

On this page