- Home /
AudioSource glitching when resuming from suspend on iOS
On Unity 4.0.1f2 and 4.2.1f2, on iOS 5.0+ across devices:
Any AudioSources that are playing when the device is suspending will glitch when the app is resumed - playing a quarter-second of audio over and over for about two seconds - before resuming normally.
We tried pausing the AudioSource in the app-pause handler and resuming in the app-resume handler, but we get exactly the same behavior. It's as if the underlying audio system is in a bad state for X seconds after resume (where X is around two).
The issue is the same whether we use compressed-in-memory or streaming audio.
We could wait to resume audio for an arbitrary number of seconds after app resume, but that's not a dependable fix across all devices/OSes.
Has anyone else experienced this recently, or successfully worked around it?
I've notice it as well in the app I'm developing. I'm using Unity 4.3.1f1. I'm specifically noticing it on the music tracks for my game which are originally wav files that setting to compressed $$anonymous$$PEG within Unity. All these tracks have been set to Stream from Disc.
There's a Unity forum discussing the issue http://forum.unity3d.com/threads/202362-Sound-issues-when-co$$anonymous$$g-back-form-background Supposedly it has been passed onto development but from what gathered it still hasn't been fixed as of yet.