Mixer AddChild()

robot_2Generated
code_blocksInput

Description

The AddChild method is used to add a new child mixer to the current Mixer instance. This allows for hierarchical audio mixing, where multiple mixers can be combined and managed under a parent mixer. The method returns the newly created child Mixer instance.

Usage

To use the AddChild method, simply call it on an instance of Sandbox.Audio.Mixer. This will create and return a new child mixer that is linked to the parent mixer.

Example

// Create a new Mixer instance
Mixer parentMixer = new Mixer();

// Add a child mixer to the parent mixer
Mixer childMixer = parentMixer.AddChild();

// Now you can configure the child mixer as needed
childMixer.Volume = 0.5f; // Set the volume of the child mixer
childMixer.Name = "Child Mixer 1"; // Set a name for the child mixer