Interface: ToolkitApi
Reusable local helpers built on Plot's public APIs.
See
Methods
syncedAudio()
syncedAudio(
options):SyncedAudio
Creates a synchronized audio object without fetching, playing, or starting readiness.
Parameters
options
Immutable URLs/mode and initial local volume/mute.
Returns
A reusable local audio object. Call dispose() when finished with it.
Throws
TypeError synchronously for invalid options or URLs.
Example
unlockAudio()
unlockAudio():
Promise<void>
Enables/resumes shared local audio. The SDK also attempts this automatically on player interaction inside the game, starting from SDK startup. Use this explicit fallback directly in a game button handler when sound remains blocked. Works before Plot.ready(). Never starts readiness or starts stopped/explicitly paused objects. Retry rejected play/resume calls with their original shared arguments; enabling audio alone does not retry a rejected playback request.
Returns
Promise<void>
Resolves once audio can run; rejects with PlotError if blocked/unavailable.