Documentation

Unity Engine


User Manual

Script Reference

Unity Engine


ControlContext

Control data communication, scripting-, creation-, destruction- and data query of ProcessorInstance s in an audio system.
Read time 2 minutesLast updated 5 days ago

Definition

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

IsSystemWideReconfiguringReturns true if the audio system is currently performing a system-wide reconfiguration.

Static Properties

Property

Description

builtInThe default provided ControlContext which is used and updated in tandem with Unity's built-in audio system.

Methods

Method

Description

AllocateGeneratorAllocate a GeneratorInstance with the specified realtime and control state.
AllocateRootOutputAllocate a RootOutputInstance with the specified processor and control state.
ConfigureManually reconfigure this GeneratorInstance with the given
format
.
DestroyDestroy a GeneratorInstance previously allocated with ControlContext.AllocateGenerator.
ExistsTest whether
processorInstance
is valid and belongs to this ControlContext.
GetConfigurationGet the declared configuration
generatorInstance
runs in.
IsGeneratorTest whether
processorInstance
is a GeneratorInstance built from a
TRealtime
and
TControl
.
IsRootOutputTest whether
processorInstance
is a RootOutputInstance built from a
TRealtime
and
TControl
.
SendMessageSend a message with a piece of data to be immediately evaluated by the ProcessorInstance.IControl<TRealtime>.OnMessage.
UpdateManually update this GeneratorInstance.

Static Methods

Method

Description

CreateManualControlContextCreate a new ControlContext with additional functionality you can drive manually.
WaitForBuiltInQueueFlushForcefully wait for any commands created on _builtIn or on any derivative objects to have taken effect.

Structs

Struct

Description

ControlContext.ManualA manually-managed ControlContext for usage outside of the normal Unity audio system (tests, custom audio system).