self:set_paused

Client

Sets the paused state of the audio-2d stream


Syntax

local status = self:set_paused(
    pause
)

Parameters

TypeNameDescription
boolpauseDetermines the paused state of the stream:
• When true - the stream is paused while preserving the playback position
• When false - the stream resumes from where it was paused

Returns

TypeNameDescription
boolstatustrue on successful execution, false otherwise

Examples

Pause and resume an audio-2d stream
local entity = core.audio_2d.create("sounds/ambient.ogg")

-- Play
entity:play()

-- Pause
entity:set_paused(true)

-- Resume
entity:set_paused(false)

On this page