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

Bug Bad audio latency

Discussion in 'Audio & Video' started by TheDavid8, Jun 22, 2023.

  1. TheDavid8

    TheDavid8

    Joined:
    Nov 19, 2013
    Posts:
    52
    Hello,

    I have really bad audio latency, to the point of when I fire a gunshot it will sound like its playing almost half a second later. I don't get this while playing other games just in Unity. I'm on Windows 11 with audio enhancements disabled. Thanks a bunch.

    upload_2023-6-22_14-37-15.png
    upload_2023-6-22_14-40-44.png
     
  2. Unifikation

    Unifikation

    Joined:
    Jan 4, 2023
    Posts:
    1,026
    Unity does have pretty bad audio latency, but this seems extreme.

    in the second screenshot, try setting the Compression Format to PCM instead of Vorbis. This should reduce it a little.
     
    TheDavid8 likes this.
  3. Hikiko66

    Hikiko66

    Joined:
    May 5, 2013
    Posts:
    1,300
    Are you using bluetooth headphones? I've read posts like this where that was the case.
    Best Latency has also introduced a lot of problems. Try change that to the alternative.

    Decompress on load will change vorbis to pcm in memory anyway, there should be no noticeable delay when playing that clip I think.
    Is it only the first time you play the clip that there is delay, or is it every time you play the clip that there is a delay?
     
    TheDavid8 likes this.
  4. TheDavid8

    TheDavid8

    Joined:
    Nov 19, 2013
    Posts:
    52
    Thanks for the reply guys. I tried hardwiring in and the latency is not as bad. My concern now is that I would have to include a disclaimer on my store page informing customers that Bluetooth headphones would not work because even on a build the delay is bad. Has anyone found a solution to this? I Play Risk Of Rain 2 with Bluetooth headphones which is made in Unity but the delay is not noticeable. I tried changing to good latency and best performance with similar results. It's every time I play the Clip. I tried playoneshot() as well with the same results. Tried changing compression to PCM as well.