self:set_paused
Client
Sets the paused state of the audio-2d stream
Syntax
local status = self:set_paused(
pause
)Parameters
| Type | Name | Description |
|---|---|---|
bool | pause | Determines 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
| Type | Name | Description |
|---|---|---|
bool | status | true on successful execution, false otherwise |
Examples
local entity = core.audio_2d.create("sounds/ambient.ogg")
-- Play
entity:play()
-- Pause
entity:set_paused(true)
-- Resume
entity:set_paused(false)