Skip to main content
cngx-src documentation

provideCngxAudio

Functioncommon/audiov0.1.0

projects/common/audio/config/audio-config.ts

Description#

Register global audio defaults. Mirrors provideFeedback — a single small config object folded through with* features.

bootstrapApplication(AppComponent, {
  providers: [
    provideCngxAudio(
      withVolume(0.6),
      withEarcons({ send: { sequence: [{ freq: 880, duration: 60 }] } }),
    ),
  ],
});

Register this at application bootstrap. The shared engine is providedIn: 'root' and reads its configuration once, when it is first built, so config registered in a lazy route's providers never reaches it. To configure a subtree, use provideCngxAudioAt(...) in viewProviders — it layers over this one and re-provides the engine so the scope actually applies.

Signature#

provideCngxAudio(...features: undefined)

Parameters#

@paramfeatures

Returns#

EnvironmentProviders