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?
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!
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…”
Thanks very much for this ![]()
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 : Native Audio - Unity Plugins by Exceed7 Experiments