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 2 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

AllocateEffectAllocate an EffectInstance with the specified processor and control state.
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 an EffectInstance previously allocated with ControlContext.AllocateEffect.
ExistsTest whether
processorInstance
is valid and belongs to this ControlContext.
GetConfigurationGet the declared configuration
generatorInstance
runs in.
IsEffectTest whether
processorInstance
is an EffectInstance built from a
TRealtime
and
TControl
.
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 EffectInstance.

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).