Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. Dismiss Notice

Question Audiosource single pop/crack sound while mixer is set to -80

Discussion in 'Audio & Video' started by Jointy87, Jun 6, 2022.

  1. Jointy87

    Jointy87

    Joined:
    Dec 19, 2019
    Posts:
    21
    Heya,

    So on awake my game loads it's audio volume settings that I had set a previous time. If I had saved it to a low value or even muted (-80), whenever I start the game and the audiosource starts to play the audio (which is set to low or muted via de mixer), a loud pop is heard. As if the mixer turned the volume down a frame too late.

    At first I thought that that was the case: The source had 'play on awake' on it, and the settings were being loaded on awake. But even after setting the source to play on a delay of 1s from a start function, after that delay the pop still plays. And in the inspector I can clearly see the mixer settings are set to -80 way before the source starts playing the sound.

    EDIT: I'm on unity 2020.3.25f1

    I looked around but couldn't find an answer to this. Any help would be greatly appreciated. Cheers!
     
    Last edited: Jun 6, 2022
  2. JLF

    JLF

    Joined:
    Feb 25, 2013
    Posts:
    137
    Is the starting volume of the mixer 0db? If so try setting it to a slightly different value other than 0. For example -0.5db.

    It’s an odd fix but I’ve had the issue you’re having before and changing the starting volume so that it’s not 0 has worked for me in the past.
     
  3. Jointy87

    Jointy87

    Joined:
    Dec 19, 2019
    Posts:
    21
    Yeah the default of the mixer channel is 0db. And once settings load it's set to -80. I tried setting another default value (-1) but the same issue persisted.

    However I've found a workaround that seems to work for this particular case:
    I was using audiosource.play after a delay. This still gave the pop.
    Now I tried doing audiosource.playDelayed with a tiny delay and now all of a sudden theres no pop.

    This works fine for what I need because it concerns playing a music track. But doubt this is a good solution for when you need to play things that are more precisely timed.
     
    lamyaslamyas likes this.
  4. lamyaslamyas

    lamyaslamyas

    Joined:
    Jan 6, 2023
    Posts:
    2
    Yep audiosource.playDelayed works for me as well