Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

Audio Delay on ipad

Discussion in 'iOS and tvOS' started by atmuc, Jul 25, 2013.

  1. atmuc

    atmuc

    Joined:
    Feb 28, 2011
    Posts:
    1,152
    i use PlayOneShot to play my audio file. it is ok on editor and mac build. there is a delay on my ipad 2. i used all audio import parameters. what is the solution?
     
  2. atmuc

    atmuc

    Joined:
    Feb 28, 2011
    Posts:
    1,152
    i found this solution. it works. if it is mandotory, why unity doesn't set it default for ios build?

    I just looked in the release notes and they mentioned a new setting for the latency.

    It can be found under Edit->Project Settings->Audio->iOS DSP Buffer Size.

    I set that to "Best Latency" and there is no longer a pronounced delay!
     
    gia-sanseverino likes this.
  3. ptdnet

    ptdnet

    Joined:
    Apr 20, 2011
    Posts:
    100
    I agree, it's pretty much a bug as far as I'm concerned. "Oh no, I *want* an annoying delay before my sounds play..."
     
  4. andymads

    andymads

    Joined:
    Jun 16, 2011
    Posts:
    1,614
    Thanks very much for this :)

     
  5. 5argon

    5argon

    Joined:
    Jun 10, 2013
    Posts:
    1,555
    If you wish to go further than "Best Latency" you can use native methods of each platform. I just made Native Audio asset store plugins which can make a native call to both iOS and Android's fastest native way from one central interface. https://www.assetstore.unity3d.com/#!/content/107067

    There are various ways of playing audio at native side, here's my choice :

    - On iOS it uses OpenAL. It is faster than AVAudioPlayer, AudioToolbox, and SystemSound.
    - On Android it uses AudioTrack, I confirmed it to be faster than SoundPool and no meaningful difference from C++ side OpneSL ES of NDK.

    I have compiled all of my findings in here : http://exceed7.com/native-audio