ControlContext
Control data communication, scripting-, creation-, destruction- and data query of ProcessorInstance s in an audio system.
Read time 2 minutesLast updated 2 days ago
Definition
- Type: Struct
- Namespace: UnityEngine.Audio
- Assembly: UnityEngine.AudioModule
public struct ControlContext
Remarks
A ControlContext effectively represents an instance of an audio system, and is responsible for synchronizing efficient and deterministic data communication between a controlling thread and a realtime audio rendering thread. Use _builtIn for scripting the shared audio system Unity uses, or use ControlContext.CreateManualControlContext for exercising your own auxillary system.
Properties
Property | Description |
|---|---|
| IsSystemWideReconfiguring | Returns true if the audio system is currently performing a system-wide reconfiguration. |
Static Properties
Property | Description |
|---|---|
| builtIn | The default provided ControlContext which is used and updated in tandem with Unity's built-in audio system. |
Methods
Method | Description |
|---|---|
| AllocateEffect | Allocate an EffectInstance with the specified processor and control state. |
| AllocateGenerator | Allocate a GeneratorInstance with the specified realtime and control state. |
| AllocateRootOutput | Allocate a RootOutputInstance with the specified processor and control state. |
| Configure | Manually reconfigure this GeneratorInstance with the given |
| Destroy | Destroy an EffectInstance previously allocated with ControlContext.AllocateEffect. |
| Exists | Test whether |
| GetConfiguration | Get the declared configuration |
| IsEffect | Test whether |
| IsGenerator | Test whether |
| IsRootOutput | Test whether |
| SendMessage | Send a message with a piece of data to be immediately evaluated by the ProcessorInstance.IControl<TRealtime>.OnMessage. |
| Update | Manually update this EffectInstance. |
Static Methods
Method | Description |
|---|---|
| CreateManualControlContext | Create a new ControlContext with additional functionality you can drive manually. |
| WaitForBuiltInQueueFlush | Forcefully wait for any commands created on _builtIn or on any derivative objects to have taken effect. |
Structs
Struct | Description |
|---|---|
| ControlContext.Manual | A manually-managed ControlContext for usage outside of the normal Unity audio system (tests, custom audio system). |