Skip to content

Interface: AudioSettings ​

Defined in: types/desktop-engine.d.ts:4351

DesktopEngine.audioSettings (API 9): the sound as the user set it for this item of content in the app, read only. undefined without the audio permission.

The app's volume and mute are above everything the content plays: what's heard is the content's mix, kept to full scale, times volume, and nothing while it's muted. The volumes the content sets in its code (Audio.volume, GainNodes, a Video's volume) only balance its own sounds below that. Both apply from the start, before index.js runs, and change without restarting the content: the values are right from index.js's first line.

The app also mutes content for reasons it isn't told, e.g. while another app plays sound, while an app is full screen or the displays sleep, by the user's playback rules: muted stays false then.

Extends ​

Properties ​

muted ​

ts
readonly muted: boolean;

Defined in: types/desktop-engine.d.ts:4356

The user muted it: all content, or this item in its details. Content that plays sound starts muted until the user turns its sound on. While it's muted, e.g. skip loading sounds, or show that it's silent


onchange ​

ts
onchange: ((this, event) => void) | null;

Defined in: types/desktop-engine.d.ts:4360

muted or volume changed


volume ​

ts
readonly volume: number;

Defined in: types/desktop-engine.d.ts:4358

The volume the user set for the item, 0...1; it starts at the manifest's audio.volume, or 1

Methods ​

addEventListener() ​

ts
addEventListener<K>(
   type, 
   listener, 
   options?
): void;

Defined in: types/desktop-engine.d.ts:4865

Type Parameters ​

Type Parameter
K extends "change"

Parameters ​

ParameterType
typeK
listener(this, event) => void
options?AddEventListenerOptions

Returns ​

void

Inherited from ​

EventTarget.addEventListener


dispatchEvent() ​

ts
dispatchEvent(event): boolean;

Defined in: types/desktop-engine.d.ts:4868

Returns false when a listener called preventDefault() on a cancelable event

Parameters ​

ParameterType
eventEvent

Returns ​

boolean

Inherited from ​

EventTarget.dispatchEvent


removeEventListener() ​

ts
removeEventListener<K>(type, listener): void;

Defined in: types/desktop-engine.d.ts:4866

Type Parameters ​

Type Parameter
K extends "change"

Parameters ​

ParameterType
typeK
listener(this, event) => void

Returns ​

void

Inherited from ​

EventTarget.removeEventListener

The SDK is released under the Apache License 2.0