Resolve the shared audio handle
injectCngxAudio
Functioncommon/audiov0.1.0
projects/common/audio/inject-audio.ts
Description#
Resolve the shared audio handle. Must run in an injection context (field initialiser or constructor).
export class MyToggle {
private readonly audio = injectCngxAudio();
protected readonly muted = this.audio.muted;
protected toggle(): void {
this.audio.setMuted(!this.muted());
}
}Signature#
injectCngxAudio()Returns#
CngxAudioHandle