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

Question Max Real Voices always limited to 32?

Discussion in 'Audio & Video' started by Q-Ted, Mar 2, 2023.

  1. Q-Ted

    Q-Ted

    Joined:
    Dec 16, 2016
    Posts:
    46
    Hello,

    We are currently experiencing an issue where we need around 64 real voices to be played (could be more), however when we set the Max Real Voices setting to be anything larger than 32 (like 64), only 32 voices will ever not be virtual and the rest won't be added to the mix.

    Is this a bug or intended? If it is intended we will have to look for an external solution.

    The unity version we are using is 2022.2.4f1.

    Thanks!

    EDIT: We also tried added the Oculus spatializer plugin, but it also seems to cap the amount of real voices to 32...
     
    Last edited: Mar 2, 2023
  2. SeventhString

    SeventhString

    Unity Technologies

    Joined:
    Jan 12, 2023
    Posts:
    435
    Hi @Q-Ted!

    Normally the limit should be 255 voices. I tried running an audio asset on ~120 AudioSources at the same time (that one!) in 2021.3.16f1, 2022.2.7f1 and even 2023.2.0a5 and by looking at the audio profiler, it looked like nothing none of these instances was virtualized. Looking into Unity's code I did not see anything that would indicate a cap at 32. From the Editor's AudioManager down to the depths of the audio engine, 255 is the only limit I see.

    Is it possible that you sources are too far from the AudioListener, or that they are not played?

    Also how are you investigating this, if it's not through the audio profiler?
     
    forestrf likes this.
  3. Q-Ted

    Q-Ted

    Joined:
    Dec 16, 2016
    Posts:
    46
    Hello @SeventhString

    Thank you for checking this and replying so swiftly!

    We are using the audio profiler to see which sounds are being virtualized. All the audio sources are within 10 units of the player. If we disable a bunch of the audio sources we start hearing the ones that were virtualized before.

    Here are screenshots of the audio source settings, profiler and Audio Settings.
    upload_2023-3-3_9-10-29.png
    upload_2023-3-3_9-2-43.png
    upload_2023-3-3_9-3-26.png

    We'll try making a fresh project to make sure its not the project, but we are unsure as to where the issue might even be.
     
  4. Q-Ted

    Q-Ted

    Joined:
    Dec 16, 2016
    Posts:
    46
    We figured it out, it seems to happen when the Load Type of the AudioClip is set to Compressed In Memory. We were experiencing big spikes when the audio sources started playing, but we'll use Decompress On Load from now on and force them to load at startup.

    There appears to be no mention of this in the documentation, so if this is an intentional limit if would be nice if that piece of information could be added to the documentation.
     
    DeathPro and Marcos-Elias like this.
  5. SeventhString

    SeventhString

    Unity Technologies

    Joined:
    Jan 12, 2023
    Posts:
    435
    That's interesting... that might be a bug. So if I understand correctly, the issue (sounds virtualized for no reason) would be attributable the their loading type? That is strange. Maybe some congestion occurs and some bookkeeping is missed once the audio is uncompressed.

    I was able to reproduce this. I'll run this with the colleagues to see if that's really expected or if there is a reason for this.

    Glad you found your solution though!
     
    Marcos-Elias and Q-Ted like this.
  6. Q-Ted

    Q-Ted

    Joined:
    Dec 16, 2016
    Posts:
    46
    That does indeed appear to be the issue here.

    Glad you were able to reproduce it on your end and thanks for looking further in to this!
     
  7. SavvaMadar

    SavvaMadar

    Joined:
    Oct 8, 2012
    Posts:
    6
    I also just ran into this when I noticed I wasn't hearing sounds I was expecting. When I switched my "Compressed In Memory" to "Decompress On Load" I was able to hear significantly more sounds.
     
  8. SeventhString

    SeventhString

    Unity Technologies

    Joined:
    Jan 12, 2023
    Posts:
    435
    Hi!
    I have to admit I wasn't able to spend time on this. Have you submitted a bug for this? It's been a while and I couldn't find if I had submitted one then.