Search Unity

Audio Sound is played with a delay.

Discussion in 'Audio & Video' started by dhanrajsinh24, Jul 22, 2018.

  1. dhanrajsinh24

    dhanrajsinh24

    Joined:
    May 8, 2014
    Posts:
    59
    I have used "Best Latency" in the sound manager and still the sound has a very big delay while playing. Is there a solution for this?
     
  2. BrandyStarbrite

    BrandyStarbrite

    Joined:
    Aug 4, 2013
    Posts:
    2,076
    Is it an audio sample, like an mp3 or wav etc?
     
  3. dhanrajsinh24

    dhanrajsinh24

    Joined:
    May 8, 2014
    Posts:
    59
    @BrandyStarbrite I have tried several audio files(.mp3, .ogg, .wav) but doesn't make any difference, same delay in every format. I am just using AudioSource.PlayOneShot(audio clip, nothing else. Is it Unity bug? I'm using latest Unity(2018) by the way.
     
    Edescal likes this.
  4. BrandyStarbrite

    BrandyStarbrite

    Joined:
    Aug 4, 2013
    Posts:
    2,076
    Okay, thanks for that info.
    Oh crap! I forgot to ask this question:

    Is the delay, at the start of each audio clip?

    And, when you play the audio clips, in an external media player
    like vlc media player etc, is there a delay?
     
    Last edited: Jul 29, 2018
  5. dhanrajsinh24

    dhanrajsinh24

    Joined:
    May 8, 2014
    Posts:
    59
    BrandyStarbrite likes this.
  6. thegodofbass

    thegodofbass

    Joined:
    Apr 22, 2018
    Posts:
    1
    Has anyone had any progress on this?

    I get latency in Windows just running this test scene in the editor - not on android or anything - this is all the scene is, a single object with this code which plays a snare .wav file:

    Code (CSharp):
    1. public class playSound : MonoBehaviour {
    2.  
    3.     public AudioClip prefabSound;
    4.     AudioSource audioSource;
    5.  
    6.     // Use this for initialization
    7.     void Start () {
    8.         audioSource = GetComponent<AudioSource>();
    9.     }
    10.    
    11.     // Update is called once per frame
    12.     void Update () {
    13.         if (Input.GetKeyDown("space")){
    14.             audioSource.PlayOneShot(prefabSound, 1F);
    15.         }
    16.     }
    17. }
    1. Latency is set to "best"
    2. Sounds are "decompress on load" and "preload audio data"
    3. The .wav files do not have any baked delay in them, they start at 0.
    4. If I get the getkeydown to do something visual there is no visual delay, so I don't think it's input delay.
     
  7. joshwaloveslotr

    joshwaloveslotr

    Joined:
    Jul 11, 2018
    Posts:
    1
    Did you ever solve this problem?
     
  8. bkdroid13

    bkdroid13

    Joined:
    Jun 3, 2019
    Posts:
    7
    I am facing this problem. please let me know your opinion.
     
  9. dormouse

    dormouse

    Joined:
    Mar 1, 2011
    Posts:
    82
    we are facing the same issue....nobody has a solution on that yet ?
     
  10. Deleted User

    Deleted User

    Guest

    My guess would be that PlayOneShot() creates this delay because the sound has to be loaded into memory first. Is there still a delay if you set the clip of the audio source in the editor and just call Play() in the script?
     
  11. danilvolfson

    danilvolfson

    Joined:
    Aug 16, 2018
    Posts:
    2
    That's happen with Play() too.
     
  12. Wilma258

    Wilma258

    Joined:
    Jun 26, 2019
    Posts:
    1
    Facing the same problem, please help me.
     
  13. Deleted User

    Deleted User

    Guest

    Does this delay correlate with the loading state of the clip? Perhaps try something like:

    Code (CSharp):
    1. public class ExampleClass : MonoBehaviour
    2. {
    3.     public AudioClip clip;
    4.  
    5.     void Start()
    6.     {
    7.         AudioSource audioSource = GetComponent<AudioSource>();
    8.         audioSource.PlayOneShot(clip);
    9.  
    10.         do {
    11.             Debug.Log(clip.loadState);
    12.         } while (clip.loadState != AudioDateLoadState.Loaded)
    13.     }
    14. }
    or something like this (perhaps set the Debug.Log() line in the Update method). Check the console and see if the time until it's loaded roughly equals the delay.

    Also, how long is the delay? Are we talking of like 50ms, 500ms, 1sec or even longer?
     
    Last edited by a moderator: Jun 27, 2019
  14. Bosskee

    Bosskee

    Joined:
    Sep 17, 2019
    Posts:
    1
    A general tip to everyone who's experiencing this issue is to ensure that you're not testing over bluetooth audio.
     
  15. Thaina

    Thaina

    Joined:
    Jul 13, 2012
    Posts:
    1,168
  16. dhanrajsinh24

    dhanrajsinh24

    Joined:
    May 8, 2014
    Posts:
    59
    @Thaina Yes you are right. @Bosskee The delay is with direct sound and not with bluetooth.@Benergy the delay is more than 500ms.
     
    Euronull likes this.
  17. jerotas

    jerotas

    Joined:
    Sep 4, 2011
    Posts:
    5,572
    I don't think that's correct. Loading should be no different than other methods such as Play that execute on the same Audio Source. If its an audio clip with "preload audio data" checked (the default) and is not a resource file, addressable or compressed file, there should be no noticeable latency in the Unity editor. But on Android, everything has latency unless you use native code.
     
  18. DaneGillburry

    DaneGillburry

    Joined:
    Sep 17, 2019
    Posts:
    5
    I thought I had this problem, but my Random Audio Script was cycling through a few options while my boolean was still true before playing the final audio choice. Just in case anyone else is using some sort of audio clip array and a boolean that is true too long.

    And in the Audio Source Priorities I changed it to High.
     
    Last edited: Sep 9, 2020
  19. kobyfr

    kobyfr

    Joined:
    Aug 21, 2020
    Posts:
    7
    I have some code I created for a typewriter effect. display a new character, make a typewriter click sound.
    I notice some latency.
    I came upon this thread, and as a result decided to measure the latency.
    these are the different setups:
    1. audio_dsp-buffer-size : best latency, audio clip type - ogg
    2. audio_dsp-buffer-size : best latency, audio clip type - wav
    3. audio_dsp-buffer-size : default, audio clip type - ogg
    4. audio_dsp-buffer-size : default, audio clip type - wav
    I know the audio clip length, and by subtracting it from the elapsed time (from the moment I call PlayOneShot() till the moment audio_source.isPlaying == false), I get the delay unity introduces.

    The build settings are for windows, and I use the internal-IDE Game window, direct sound.
    I averaged between 20 and 40 playbacks, for each setup.

    Results
    1. audio_dsp-buffer-size : best latency, audio clip type - ogg - 11 msec
    2. audio_dsp-buffer-size : best latency, audio clip type - wav - 11 msec
    3. audio_dsp-buffer-size : default, audio clip type - ogg - 14 msec
    4. audio_dsp-buffer-size : default, audio clip type - wav - 14 msec

    Code
    Code (CSharp):
    1.     void Update()
    2.     {
    3.         int cur_story_length = storyText.text.Length;
    4.         if (cur_story_length < story_level_1.Length)
    5.         {
    6.             if (audio_source.isPlaying == false && has_audio_started)
    7.             {
    8.                 has_audio_started = false;
    9.                 Debug.Log("audio stopped. " + cur_audio_clip + " delay " + (Time.time - time_since_last_char - cur_audio_clip.length));
    10.             }
    11.             float cur_time = Time.time;
    12.             if (cur_time - time_since_last_char > random_interval)
    13.             {
    14.                 char c = story_level_1.ToCharArray()[cur_story_length];
    15.                 time_since_last_char = Time.time;
    16.                 switch (c)
    17.                 {
    18.                     case '.':
    19.                         cur_audio_clip = bellSFX_ogg;
    20.                         break;
    21.                     default:
    22.                         if (cur_story_length % 2 == 0)
    23.                             cur_audio_clip = clickSFX_wav;
    24.                         else
    25.                             cur_audio_clip = clickSFX_ogg;
    26.                         break;
    27.                 }
    28.                 Debug.Log(cur_time + " " + cur_audio_clip + " random_inerval = " + random_interval);
    29.                 has_audio_started = true;
    30.                 audio_source.PlayOneShot(cur_audio_clip);
    31.                 storyText.text += c;
    32.  
    33.                 // Select next interval
    34.                 Random.InitState((int)Time.time * 1000);
    35.                 random_interval = Random.Range(0.5F, 1.5F) * time_base_interval_between_characters;
    36.             }
    37.         }
    38.     }
    Maybe this is platform specific? I will try to have the logs output directly on a windows console, and on an android platform via logcat, and see the differences.

    Update
    building the windows app and running it with logs directed to a file, I get these worse delays, with the audio-dsp set to "best latency":

    ogg : 38 msec
    wav : 41 msec


    I have to say that calling AudioSource.isPlaying has a significant impact on audio performance, and I had to dilute the number of times I call it. Otherwise, the audio becomes jittery and distorted. I diluted the calls by checking isPlaying() only after AudioSource.Length has elapsed.

    Here is the updated code
    Code (CSharp):
    1.     void Update()
    2.     {
    3.         int cur_story_length = storyText.text.Length;
    4.         if (cur_story_length < story_level_1.Length)
    5.         {
    6.             float cur_time = Time.time;
    7.             if (cur_audio_clip != null &&
    8.                 (cur_time - time_since_last_char > cur_audio_clip.length) &&
    9.                 (audio_source.isPlaying == false && has_audio_started))
    10.             {
    11.                 has_audio_started = false;
    12.                 Debug.Log("audio stopped. " + cur_audio_clip + " delay " + (Time.time - time_since_last_char - cur_audio_clip.length));
    13.             }
    14.             if (cur_time - time_since_last_char > random_interval)
    15.             {
    16.                 char c = story_level_1.ToCharArray()[cur_story_length];
    17.                 time_since_last_char = Time.time;
    18.                 switch (c)
    19.                 {
    20.                     case '.':
    21.                         cur_audio_clip = bellSFX_ogg;
    22.                         break;
    23.                     default:
    24.                         if (cur_story_length % 2 == 0)
    25.                             cur_audio_clip = clickSFX_wav;
    26.                         else
    27.                             cur_audio_clip = clickSFX_ogg;
    28.                         break;
    29.                 }
    30.                 Debug.Log(cur_time + " " + cur_audio_clip + " random_inerval = " + random_interval);
    31.                 has_audio_started = true;
    32.                 audio_source.PlayOneShot(cur_audio_clip);
    33.                 storyText.text += c;
    34.  
    35.                 // Select next interval
    36.                 Random.InitState((int)Time.time * 1000);
    37.                 random_interval = Random.Range(0.5F, 1.5F) * time_base_interval_between_characters;
    38.             }
    39.         }
    40.     }
    Update 2

    On Android, similar delay (33 msec and 50 msec observed, similar average to windows - ~40 msec).
    However, the video event seems a lot closer, on the time line, to the audio event, in Android.
    In windows, the video event seems to precede the audio event by a greater interval.

    Update 3
    On Android via BT Audio, I get similar numbers (40 msec).
    However, I see that this measurement does not reflect reality, because a significant delay is apparent when observing the time difference between the visual and the audio, clearly several 100ths of milliseconds.
    So, polling AudioSource.isPlaying proved to measure the time it took AudioSource to delegate the audio clip to the next block, i.e. a lower level audio driver (direct sound) or block (BT).
    The additional delay caused by the low level driver or HW, or by the next communication channel (bluetooth), is not reflected by the state returned by isPlaying().

    Hopefully more experienced game and audio programmers can note on ways the delay can be more accurately measured.
    Maybe
     
    Last edited: Oct 3, 2020
  20. MassimoFrancesco

    MassimoFrancesco

    Joined:
    Jul 6, 2019
    Posts:
    44
    I've run into the same audio delay issue and have fixed it.
    Two issues combined created noticeable lag inside the Editor.

    * switched from Bluetooth headset to an analog headset
    * changed "DSP Buffer Size" from "Default" to "Best latency" (Project Settings > Audio)

    Each of these two points otherwise create a small delay which adds up. Now I've got no lag at all.
     
    marcoantap and mreilly204 like this.
  21. cyangamer

    cyangamer

    Joined:
    Feb 17, 2010
    Posts:
    234
    Have others besides dhanrajsinh24 confirmed if (along with setting DSP Buffer Size to "best latency") this solution solves the bluetooth/wireless headset audio lag issue? Or if there's another solution? AirPods and similar devices are only going to continue to rise in popularity, and I could see this affecting app and play store reviews from airpod users.
     
  22. Starbox

    Starbox

    Joined:
    Sep 17, 2014
    Posts:
    470
    But a latency that reaches over 300 ms? I have encountered the same issue and I thought I was doing something wrong. I optimized the compressions and the best permutations but the sounds are exactly off of more than half a second.
    Looking into it and "solutions", there's the suggestion to have an extension hack through this and play the sound using native tools. We can read this:
    Is supposed to mean that Unity's mixer is responsible for adding a non-negligible amount of latency, on top the other phases a sound goes through before it's fired through the speakers?

    I tried the "best latency" option and my audio files are all optimized for minimal loading in real time, even the smallest sounds are stored as PCM in the RAM, yet they suffer this horrible latency that approaches half a second or perhaps a bit more.

    So now one is told there's an extension in the Asset store to correct that stupid limitation, and it's around $30 to have the privilege of having sounds playing when requested, with a latency at least below 80 ms? This is not to disparage the publisher's work, but a system working relatively properly, that is, without worsening on the default conditions, should be the base template for any Unity project on Android. Working properly shouldn't be an extra feature.
    Unity might think about buying this dev's addon and making it a package.
     
  23. Starbox

    Starbox

    Joined:
    Sep 17, 2014
    Posts:
    470
    Has anyone tried this? Git rep here. Last commit is 5 years old though but it might still work.
     
  24. shatganseven

    shatganseven

    Joined:
    Apr 16, 2021
    Posts:
    1
    I solved the problem!

    set the sound in a game object with the audio soucre and the option play on awake:

    GameObject Sound;

    When you want to play the sound write this code

    Sound.active = true;

    or if you goes to use the sound often you can make this

    to spawn

    Instantiate(Sound, Vector3, Quaternion);

    to destroy the Game Object;

    Code (CSharp):
    1. float timer, life = 2;
    2.  
    3.  
    4.  
    5. Update()
    6. {
    7.  
    8. timer += Time.deltaTime;
    9.  
    10. if(timer > life)
    11. {
    12. Destroy(gameObject);
    13. }
    14.  
    15. }
    16.  
    }
     
  25. Starbox

    Starbox

    Joined:
    Sep 17, 2014
    Posts:
    470
    Does this kill the delay?
    It seems you are implying that keeping sound files active might cause the weird delay.
     
  26. WhyCantIUseMyLogin

    WhyCantIUseMyLogin

    Joined:
    Oct 1, 2013
    Posts:
    14
    I am just going to throw a suggestion into the (excuse the pun) mix, here. I am often frustrated with things like little delays, and/or crackles with audio in Unity. My particular problem which brought me here was a) a tiny delay before a sound would start playing (this delay, needless to say, is not in the source audio file) and b) a crackle that occurs often when calling .Stop on the file (it is a 5 second constantly changing sound, so looping is not an option, and it needs to be stopped immediately when the player releases a trigger).

    Note that I am using PlayOneShot().

    I tried all the usual things, like using a .wav rather than a .mp3, and ensured the Load in Background flag was set in the import settings.

    None of this helped.

    I also found that muting the audio before stopping it, and/or setting the volume to 0, didn't improve matters.

    So, I decided to crack the walnut with a sledgehammer, and (instead of calling Stop() immediately) I created a Coroutine to stop the audio playing after a short delay.

    Code (CSharp):
    1.    
    2. IEnumerator StopWithRapidFade(AudioSource a)
    3. {
    4.         //this method is required to avoid the nasty click that happens even if the volume is set to 0 or it is muted.
    5.         a.mute = true;
    6.         yield return new WaitForSeconds(0.1f);
    7.         a.Stop();
    8. }
    (Obviously the length of delay needs to be adjusted for your needs)

    This does stop the click at the end (it's almost like the Mute takes a while to work....?) but a) obviously doesn't help the delay at the start, and b) introduces a new problem where a sound can still be playing when it called to play again.

    So, in a fit of madness I decided to try using 2 identical audiosources (on different gameobjects), and flip-flop between them. The flip-flop is performed when the sound is terminated. Something like this:

    Code (CSharp):
    1.    
    2. bool _flip
    3.  
    4. internal void PlayFX_Start()
    5. {
    6.         if (_flip)
    7.         {
    8.             playerFX_flip.mute = false;
    9.             PlayOneShot(playerFX_flip);
    10.         }
    11.         else
    12.         {
    13.             playerFX_flop.mute = false;
    14.             PlayOneShot(playerFX_flop);
    15.         }
    16. }
    17.  
    18. internal void PlayFX_End)
    19. {
    20.         if (_flip)
    21.         {
    22.             StartCoroutine(StopWithRapidFade(playerFX_flip));
    23.         }
    24.         else
    25.         {
    26.             StartCoroutine(StopWithRapidFade(playerFX_flop));
    27.         }
    28.         _flip = !flip;
    29.      
    30. }
    This not only stopped the clicking, but also seemed to alleviate (under my very specific circumstances!) the delay at the start!

    This leads to me believe that the delay is in fact introduced when playing the same audio source mutliple times.

    Obviously this could be expanded to use a counter rather than a bool to select audiosources should you need to trigger sounds quikcer than me, but it solved my problem.

    I know this was a long post, and possibly totally inapplicable to your requirements but it solved my problem, and I thought it might be of use to some poor lost soul.

    --Mike--

    (Oh, and I apologise for the formatting of the code; this was done by the webpage, and any attempts to edit it gets an error that I am creating 'spam-like content'... I didn't think my code was THAT bad!)
     
    Last edited: Jul 1, 2021
    marcoantap, ranjansikand and Starbox like this.
  27. Starbox

    Starbox

    Joined:
    Sep 17, 2014
    Posts:
    470
    Interesting. I suppose this was on Android only.
    Have you experienced any measurable delay at the start of a sound and has your method somehow, strangely, managed to reduce this while working strictly from within Unity?
     
  28. Mickplouffe

    Mickplouffe

    Joined:
    Aug 30, 2019
    Posts:
    3
    WELL, I was looking for this problem because I was getting delay while using Doozy UI Soundy. I was about to write to them. To finally test in Unity and the delay of like .25 seconds. For like half an hour. I tested "everything".

    To then come here I read you to facepalm myself hard.

    The worst is that I know Bluetooth has a delay. But since it is generally under .5of a second on my high-end headphones, I don't notice it for day-to-day usage...

    Thanks, Bosskee.
     
  29. Starbox

    Starbox

    Joined:
    Sep 17, 2014
    Posts:
    470
    Testing on Android devices should always be done with the rawest configuration possible, i.e. without extra peripherals or else.
     
  30. ranjansikand

    ranjansikand

    Joined:
    Apr 8, 2021
    Posts:
    110
    Yeah, it seems to be using the same audio source. For example, I called one audio clip (play one shot), it works perfectly. But after that, every clip has a random delay that offsets it from the animation motion. Other sounds seem to be working fine.

    I’m going to see if I can attach multiple audio sources to the same object and try that
     
  31. Starbox

    Starbox

    Joined:
    Sep 17, 2014
    Posts:
    470
    Have you tried this as a comparison between different operating systems?
    As far as Android in concerned, I cannot agree with your conclusion because I have observed these delays on all types of sounds and above all even those played once, the delays happening at the very first playing too.
    Perhaps you mean an audio source that can be played multiple times because of the way it's called, ergo the very function that is used to play the sound. Someone above suggested something along those lines because of a necessary preloading.
    But no amount of optimization, even of the dirty and destructive type, removed the delays.
    On Android it appears the delays are largely due to the device, or more specifically how Unity plays on a given device. IOW, Unity performs better on some devices than on others and there's nothing you can do about it.
     
  32. ranjansikand

    ranjansikand

    Joined:
    Apr 8, 2021
    Posts:
    110
    If anyone is on this thread, I solved this issue. I switched audio settings to "best latency," but what seemed to be the issue is that multiple audio sources are playing sounds at the same priority. Changing the priority for some of them eliminated the delays
     
  33. Starbox

    Starbox

    Joined:
    Sep 17, 2014
    Posts:
    470
    The Best latency option simply does not solve anything on many Android systems. The issue lies deeper.
     
  34. david-milian

    david-milian

    Joined:
    Jul 13, 2019
    Posts:
    6
    Of course!!! that was it.
     
  35. CoalesceLanguidly

    CoalesceLanguidly

    Joined:
    Dec 21, 2021
    Posts:
    5
    Might be worth trying this technique by Brackeys. Works fine for me, although I'm not on android currently.

    He also mentions some import sound settings on the clip itself. I looked at those and It's possible to change from compressed to streaming for example, don't know if this will help you but worth a try.

     
  36. FOW_Mind

    FOW_Mind

    Joined:
    Jan 21, 2022
    Posts:
    1
    tuncaym likes this.
  37. MiniMinnow

    MiniMinnow

    Joined:
    Jan 17, 2022
    Posts:
    1
    This was my issue - fixed it!
     
  38. catambroise

    catambroise

    Joined:
    May 19, 2015
    Posts:
    2
    click on your audio and put the load type as streaming, it did the trick for me !
     
  39. jay_m1

    jay_m1

    Joined:
    Nov 18, 2019
    Posts:
    3
    just to add to this- despite the previous comment saying "i have tried various audio file formats and nothing works", i experience delay with MP3, but not with wav files + load type as "streaming". playing around with audio priority may be a good idea if you have multiple sounds.
     
  40. stgm1

    stgm1

    Joined:
    Jul 23, 2014
    Posts:
    6
    THIS ! I was not understanding why it was not working like before. I was using bluetooth audio...
     
  41. Seanqw3

    Seanqw3

    Joined:
    Jan 30, 2021
    Posts:
    1
    Removing AudioSource.isPlaying solved it for me. I didn't measure the latency but it probably resolved 300-500ms on a high performance machine. Thanks!
     
  42. mreilly204

    mreilly204

    Joined:
    Jan 11, 2023
    Posts:
    5
    THIS! Worked for me
     
  43. ujz

    ujz

    Joined:
    Feb 17, 2020
    Posts:
    29
    For anyone who didn't fix their problem w above, the solution posted by Unity here solved it for me. There is a 1-3 frame delay when loading any audio file (opening, buffering, etc), so you schedule the next clip and "warm up" the audiosource ahead of time.
     
  44. screenrider

    screenrider

    Joined:
    May 5, 2023
    Posts:
    1
    I also encountered this problem (Windows) and I'd like to share my approach.
    I tried different audio formats, project settings and clip settings. Nothing fixed the problem.
    The sound file itself is not the reason; it is played back with almost no latency in other applications.

    So I suspected it might have something to do with the Unity Editor and Windows sound settings
    (sort of a battle between Editor, Game Mode and Windows... whatever).

    I made the following settings under:
    Sound->Speaker->Playback Tab->Propertiers->Advanced Tab
    - uncheck 'Signal Enhancements'

    No more latency! :)
    Even with all (Unity Audio) settings left at default.

    I still have no idea if this is just a kind of workaround and the latency will show up again in the build, but game development is hardly possible with such massive latencies between keystrokes and sound playback.
     
    marcoantap and Marten790 like this.
  45. BurningthumbStudios

    BurningthumbStudios

    Joined:
    Apr 28, 2008
    Posts:
    95
    I recently reverted a project from Unity 2022 back to Unity 2021 due to abysmal performance on mid range Android. I had this problem. Audio had a HUGE lag. The solution was:
    • Project Settings > Audio > DSP Buffer Size > Best latency

    On a side note, my player was punching through the terrain and it turned out that half my box colliders also got messed up (size set to 2,2,2 instead of 1,1,1). No idea how that happened.

    What a mess Unity has become.
     
  46. andrianovyaroslav27

    andrianovyaroslav27

    Joined:
    Sep 19, 2021
    Posts:
    8
    I figured the problem. In my case the problem was a big amount of active audio sources. Profiler showed that the amount was around 100, when I disabled some for testing, leaving only 50, lag disappeared (it used to be up to 7 seconds, lol)
     
  47. Starbox

    Starbox

    Joined:
    Sep 17, 2014
    Posts:
    470
    Are you using them in a 3D environment? I saw audio sources components as being rather inert until used, being references leading to assets.

    If a very low sound latency is a very important aspect of your game then you will have to use a native management, which is unfortunate because it renders all sorts of filters and modifiers unusable, and you may even have to simulate them manually by producing audio files for each case scenario. Worst of all, depending on the phone you're using the loading of files might take some time that you cannot speed up. However modern upper range smartphones gulp native files very fast, but mid range devices might still be significantly slower.
     
  48. Upside-Down-Bird

    Upside-Down-Bird

    Joined:
    Jun 11, 2014
    Posts:
    7
    Why does the unity doc show using isPlaying inside of the update loop? https://docs.unity3d.com/ScriptReference/AudioSource-isPlaying.html
     
  49. ryandebraal

    ryandebraal

    Joined:
    Sep 23, 2015
    Posts:
    8
    Solved the lag by converting the source audio from a .mp3 to an .ogg

    I also set:
    Edit > Project Settings > Audio > DSP Buffer Size: Best Latency
     
  50. RageByte

    RageByte

    Joined:
    Jul 2, 2017
    Posts:
    34
    Just had this issue and it was because I was using a BT speaker. Thanks man.