Skip to main content
cngx-src documentation

CNGX_AUDIO_ENGINE_FACTORY

Tokenv0.1.0

InjectionToken<CngxAudioEngineFactory>

Description#

Swappable engine factory. Defaults to createAudioEngine. Override to wrap the engine with telemetry/audit logging — the documented second consumer of this boundary token.

Register the override at application bootstrap. The shared engine instance is itself providedIn: 'root' and is built on first use, so a factory override registered in a lazy route's providers is never consulted. For a subtree that needs its own engine, use provideCngxAudioAt(...) in viewProviders.

An override that needs the resolved configuration reads it with injectAudioConfig (defaults merged); CNGX_AUDIO_DEFAULTS holds the library baseline. Both are exported from @cngx/common/audio.

Type#

InjectionToken<CngxAudioEngineFactory>

Provided in#

'root'