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

ControlContext

struct in UnityEngine.Audio

/

Implemented in:UnityEngine.AudioModule


Implements interfaces:IAudioScriptingContext

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 Processors 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
builtInThe default-provided ControlContext which is used and updated in tandem with Unity's built-in audio system.

Public Methods

Method Description
AllocateGeneratorAllocate a Generator with the specified processor and control state.
AllocateRootOutputAllocate a RootOutput with the specified processor and control state.
DestroyDestroy a Processor previously created from this context.
ExistsTest whether a given Processor still exists.
GetAvailableDataAccess an enumerator to the currently available data on the Processor. This has been communicated back and accumulated from the Processor itself during all the Audio.Processor.IProcessor.RealtimeReturnData calls that happened since the last frame update.
GetConfigurationGet the declared configuration the Generator in question runs in.
IsGeneratorTest whether the Processor is a Generator built from the specified components.
IsRootOutputTest whether the Processor is a RootOutput built from the specified components.
SendDataSend a piece of data to make it available to the processor in the next mix cycle where Processor.IProcessor.DataAvailable will be called.
SendMessageSend a message with a piece of data to be immediately evaluated by the processor's Audio.Processor.Control.OnMessage.

Static Methods

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