Search Unity

Audio Cloning AudioMixers or Groups?

Discussion in 'Audio & Video' started by eric_funktroniclabs, Apr 5, 2019.

  1. eric_funktroniclabs

    eric_funktroniclabs

    Joined:
    Oct 4, 2018
    Posts:
    19
    Is there a way to make instances of mixer groups at runtime?

    Our use case is to make a series of sound loops that can each have their filters modified at runtime, independently. Some example code:

    Code (CSharp):
    1. var mixer = Instantiate(pfbMixer);
    2. mixer.audioMixer.SetFloat("Pitch", Random.value * 2);
    3. source.outputAudioMixerGroup = mixer;
    This results in the cloned mixer having no influence on the audio source. Does anyone have any advice on how to approach this?

    Copying the toplevel mixer also results in a "cloned" mixer that ends up being a proxy to the original mixer anyway, rendering the cloning pointless.
     
    Last edited: Apr 5, 2019