Struct AudioConfig
Configures the global audio state, which you can access via TinyEnvironment.GetConfigData This component is attached to the Config entity.
Namespace: Unity.Tiny.Audio
Syntax
public struct AudioConfig : IComponentData
Fields
initialized
True if the audio context is initialized.
Declaration
public bool initialized
Field Value
Type | Description |
---|---|
System.Boolean |
Remarks
After you export and launch the project, and the AudioSystem updates for the first time, the AudioConfig component attempts to initialize audio. If successful, it sets this value to true.
Once audio is initialized successfully the AudioConfig component does not re-attempt to initialize it on subsequent AudioSystem updates.
paused
If true, pauses the audio context. Set this at any time to pause or resume audio.
Declaration
public bool paused
Field Value
Type | Description |
---|---|
System.Boolean |
unlocked
True if the audio context is unlocked in the browser.
Declaration
public bool unlocked
Field Value
Type | Description |
---|---|
System.Boolean |
Remarks
Some browsers require a user interaction, for example a touch interaction or key input, to unlock the audio context. If the context is locked no audio plays.