Search Unity

  1. We are migrating the Unity Forums to Unity Discussions by the end of July. Read our announcement for more information and let us know if you have any questions.
    Dismiss Notice
  2. Dismiss Notice

Audio AudioSource not playing / interrupting in Android Build

Discussion in 'Audio & Video' started by mitaywalle, May 9, 2024.

  1. mitaywalle

    mitaywalle

    Joined:
    Jul 1, 2013
    Posts:
    262
    We have a lots of AudioSource playing same time.
    In Editor everything is fine, we hear all of them.
    In Android Build some AudioSource sound interrupt and not play at all

    AudioSource priority is same: 128
    ProjectSettings.Audio.MaxVirtualVoices: 512
    ProjectSettings.Audio.MaxRealVoices: 32

    1. Can i reproduce this behaviour in Editor?
    2. Will high priority help with AudioSources stutter / not play in Build?
     
  2. SeventhString

    SeventhString

    Unity Technologies

    Joined:
    Jan 12, 2023
    Posts:
    454
    Hi!
    Happy 255th post, I love a good round number :D

    I don't think the AndroidPlayer handles MaxRealVoices differently, so it might be a performance issue? What is the mobile devices you're testing with? If you can try on another device to see if the behaviour is consistent that would be interesting information.

    Are you overriding your `AudioClip`s loading/compression/format/quality settings? I would start by investigating the loading type, as this is what has the biggest impact on how the engine processes the sounds.

    About reproducing on the Editor, I'd try lowering the RealVoices value to see if the result is similar.

    Also, when you say "a lot" of `AudioSource`s how many are we talking about? A big number of spatialized sources generally benefits from better priority segmentation.

    Cheers!
     
    mitaywalle likes this.
  3. mitaywalle

    mitaywalle

    Joined:
    Jul 1, 2013
    Posts:
    262
    Thank you for fast answer, and for congradulations!

    1. I have reproduced this behaviour in editor, so this question can be skipped

    2. After reproduction I've tested AudioSource.priority - and it worked for me

    Another questions became not important, problem solved. Thank you