Search Unity

  1. Unity 6 Preview is now available. To find out what's new, have a look at our Unity 6 Preview blog post.
    Dismiss Notice
  2. Unity is excited to announce that we will be collaborating with TheXPlace for a summer game jam from June 13 - June 19. Learn more.
    Dismiss Notice

Resolved Why Audio Mixer only affect scene with AudioListener inside of it?

Discussion in 'Audio & Video' started by HexDog, Apr 3, 2024.

  1. HexDog

    HexDog

    Joined:
    Mar 31, 2019
    Posts:
    57
    Let assume we have 3 scene loaded additively: A, B and C, where A is the "main" scene with AudioListener inside of it. Each scene has it's own AudioSources, the sources sharing the same output group from the same AudioMixer, for example "sfx". The question is when we set the sfx volume to -80db (mute), why AudioSources inside scene B and C is still hearable, when they sharing the same output? It's becasue of they have no AudioListener like scene A (there can only one listener)? Can anyone explane it to me? Thanks in advance!

    Note: This might won't make effect inside the editor, but after building it surely appiers. (At least at Android platform)

    UPDATE: the problem caused by Addressables.
     
    Last edited: Apr 4, 2024
  2. SeventhString

    SeventhString

    Unity Technologies

    Joined:
    Jan 12, 2023
    Posts:
    430
    Hi!

    What do you mean by this? Can you provide more details please?
     
  3. HexDog

    HexDog

    Joined:
    Mar 31, 2019
    Posts:
    57
    Certainly, my original hypothesis about AudioListener was wrong. The problem was that every scene, except the main scene, was loaded by the addressable system. Because the addressables do not use the asset database to load content, the audio mixers got duplicated every time a scene was loaded. Practically, each scene has its own mixer, which is why only the main scene was affected by the changes. Now, because fast loading was turned on in the editor, the addressable system uses the asset database to load content. That's why the problem didn't appear until I built the game.

    Solution: A singleton audio manager loaded by the addressable system, and on awake, assigning the correct output from that singleton to the audio sources.
     
  4. SeventhString

    SeventhString

    Unity Technologies

    Joined:
    Jan 12, 2023
    Posts:
    430
    I discussed that with the audio authoring team and apparently, it's a known quirk of the addressable system. Here is their internal note on this matter (shared with their consent :cool:)

    Thank you for shedding more light on this, I hope in time this will lead to more improvements.

    Cheers!
     
    HexDog likes this.
  5. HexDog

    HexDog

    Joined:
    Mar 31, 2019
    Posts:
    57
    You are welcome! :)