Search Unity

Audio quality drops after 30 objects active in scene

Discussion in 'Audio & Video' started by Dazz500, Apr 1, 2017.

  1. Dazz500

    Dazz500

    Joined:
    Nov 13, 2014
    Posts:
    64
    Hi all,
    so I've got 40 instantiated objects in the scene, which when it starts are all inactive & they get switched to active every 0.2 seconds. Each objects has 3 audio clips, 2 play simultaneously when the object is activated & the 3rd is only played in specific conditions. The objects are spread about though out the scene and each object is normally well outside the the other objects audio max distance.
    So when the objects are being activated the object that has the audio listener on sounds fine until the total active objects exceeds 30, then the quality drops. In the stats window there is no clipping occurring. In the profiler total audio cpu is 5.8%, total audio memory 10.2MB, sample sound memory 7.2MB
    Any ideas of how to fix or settings i need to look at greatly appreciated.
    The only idea I had was to switch audio off from the objects that are further than a certain distance away from the camera / listener by script but I'm guessing this is done automatically anyway.
    (BTW I'm using unity 5.0.0.f4 )
     
  2. mtytel

    mtytel

    Joined:
    Feb 28, 2014
    Posts:
    84
    Not sure what the quality decrease you're talking about is, but you might be running up against the project limit of concurrent voices in Unity.
    Go to Edit -> Project Settings -> Audio
    Set the Max Real Voices to 64 instead.
     
    laurentlavigne likes this.
  3. Dazz500

    Dazz500

    Joined:
    Nov 13, 2014
    Posts:
    64
    I tried my idea
    (The only idea I had was to switch audio off from the objects that are further than a certain distance away from the camera / listener by script but I'm guessing this is done automatically anyway.
    (BTW I'm using unity 5.0.0.f4 ))

    and it worked :)

    Cheers for reply though.
     
  4. laurentlavigne

    laurentlavigne

    Joined:
    Aug 16, 2012
    Posts:
    6,362
    I'd think that you're better off letting unity's audio internals handle priority.
    I had my audios set to 32, sounds would disappear. Cranked it up to 64 and now all is good.
    Each creature has a priority and range based on their heft, it works quite well when you see a giant one bashing your shuttle from far away.
    2017 LTS though... and audio cpu went from 3.4% to 5.8%