Version: Unity 6.3 Beta (6000.3)
LanguageEnglish
  • C#

ControlContext

struct in UnityEngine.Audio

/

Implemented in:UnityEngine.AudioModule


Implements interfaces:IContext

Suggest a change

Success!

Thank you for helping us improve the quality of Unity Documentation. Although we cannot accept all submissions, we do read each suggested change from our users and will make updates where applicable.

Close

Submission failed

For some reason your suggested change could not be submitted. Please <a>try again</a> in a few minutes. And thank you for taking the time to help us improve the quality of Unity Documentation.

Close

Cancel

Description

Control data communication, scripting-, creation-, destruction- and data query of ProcessorInstances in an audio system.

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 ControlContext.builtIn for scripting the shared audio system Unity uses, or use ControlContext.CreateManualControlContext for exercising your own auxillary system.

Static Properties

Property Description
builtIn The default provided ControlContext which is used and updated in tandem with Unity's built-in audio system.

Public Methods

Method Description
AllocateGenerator Allocate a GeneratorInstance with the specified realtime and control state.
AllocateRootOutput Allocate a RootOutputInstance with the specified processor and control state.
Destroy Destroy a GeneratorInstance previously allocated with ControlContext.AllocateGenerator.
Exists Test whether is valid and belongs to this ControlContext.
GetAvailableData Access an enumerator to the currently available data on the ProcessorInstance.
GetConfiguration Get the declared configuration runs in.
IsGenerator Test whether is a GeneratorInstance built from a TRealtime and TControl.
IsRootOutput Test whether is a RootOutputInstance built from a TRealtime and TControl.
SendData Send a piece of data to make it available to the processor in the next ProcessorInstance.IRealtime.Update.
SendMessage Send a message with a piece of data to be immediately evaluated by the ProcessorInstance.IControl_1.OnMessage.

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.