implements Audio.Source Audio.Sink
An audio mixer. The mixer can contain any number of inputs and outputs. Independent gain values can be set for each input/output pair and these gains can be controlled via scheduled events.Mixer(integer inputs, integer outputs, array gains) | create a new audio mixer |
input | Audio.Connector inputs as an array |
output | Audio.Connection outputs as an array |
add(Audio.Connection connection, array gain) | connect the given Audio.Connection to the next unused input |
add(Audio.Connection connection, float gain) | connect the given Audio.Connection to the next unused input |
add(Audio.Source source, array gains) | connect the given Audio.Source to the next unused inputs of this mixer |
add(Audio.Source source, float gain) | connect the given Audio.Source to the next unused inputs of this mixer |
gain(integer input, array gains) | change the gain between an input and output |
gain(integer input, integer output, float gain) | change the gain between an input and output |
play(Audio.Buffer buffer) | immediately play an audio buffer |
play(Audio.Clip clip) | immediately play an audio clip |
schedule(Audio.Buffer buffer, float measure, Time.Clock clock) | schedule an audio buffer to play |
schedule(Audio.Clip clip, float measure, Time.Clock clock) | schedule an audio clip to play |
schedule(Audio.MixerGain gain, float measure, Time.Clock clock) | schedule a gain change between a given input and output |
Create a new audio mixer. Initial gains may be set by an optional gains array argument. If this argument is omitted initial gains will be set as follows:
* The first input channel connects to the first output channel with unity gain, all other outputs are not connected
* Each subsequent input connects to the next output channel, or back to the first output channel if they run out
* Continue until all input channels are each connected to one output channel (output channels may not all be connected)
Audio.Connector inputs as an array. Adding or removing elements to this array has no effect on the underlying audio component.
Audio.Connection outputs as an array. Adding or removing elements to this array has no effect on the underlying audio component.
Connect the given Audio.Connection to the next unused input
Connect the given Audio.Connection to the next unused input. If an optional gain value is given this input will be connected to every output with that gain factor.
Connect the given Audio.Source to the next unused inputs of this mixer. An array of values can be given to set gains on the newly connected input.
An exception will be thrown if not enough free inputs are available.
Connect the given Audio.Source to the next unused inputs of this mixer. If an optional gain value is given the newly connected inputs will have gains set as follows:
* The first input from the audio source will connect to the first output channel of the mixer. All other output channels will have gain 0.0 (disconnected)
* Each subsequent input will connect to the next output channel, or back to the first if they run out
An exception will be thrown if not enough free inputs are available.
Change the gain between an input and output
Change the gain between an input and output
Immediately play an audio buffer.
Immediately play an audio clip.
Schedule an audio buffer to play.
Schedule an audio clip to play.
Schedule a gain change between a given input and output.