- Home /
IPhone 4 and IPad 2 lost audio on resume
I am working on an app for the ios and have found that if I quickly minimize and re-open the app all sound is lost. If I do this more slowly or re-open the app again the sound will return. Both the power button and the home button will cause this issue.
I have tried adding a call to Play for each audio source inside of the OnApplicationPause during resume as well as calling Stop on audio sources on minimize and then calling Play on resume.
Has anyone else had this issue and found a solution or have any suggestions for what I could try to fix the problem. Thanks.
Edit: I have noticed that when the audio does not go away and I minimize and resume a bunch of times the audio will fade in and out for a time based on the amount of times that I minimized and resumed before it plays as normal.
Edit2: I now have it where the audio does not always get lost. Atm I have multiple audio sources some for music and sfx. When I minimize the game I capture the audio time and call stop on the source. When I resume I reset the time and call play. This works most of the time, but if I continue to minimize the game and return it will eventual return without audio. After I have lost audio I can call play all throughout the game but never hear any audio. When I minimize and resume again the audio will return and I can repeat until it is lost again.