Post

Replies

Boosts

Views

Activity

Audio Playback Issue in Unity-Developed iOS App: Intermittent Sound Output
Hello, I am reaching out for assistance with a problem I've encountered while developing an iOS app using Unity. Recently, in apps built with Unity versions 22.03.14 and 22.03.17, we have been experiencing issues with AudioSource not properly playing background music (BGM) and TTS MP3 files received from the server. Here is the situation: In the initial map scene, BGM and TTS files play normally. However, from the next scene onwards, no sound from AudioSource can be heard. This issue persists even if we return to the first scene. Interestingly, sounds from an external video call asset called Agora SDK are audible. This issue has occurred in Xcode versions 14.3.1, 15, and 15.2. The app functions correctly on other OSs (Windows, Mac, Android). Additionally, when the app is moved to the background and then reactivated, the BGM starts to work again normally. At this point, briefly hearing the previous BGM suggests a potential issue with iOS audio initialization. Furthermore, we use Addressables.LoadSceneAsync for scene loading. Here, scenes are loaded in Additive mode, and after the loading scene covers the screen, the previous scene is deleted before the next scene is loaded (using the Unload method provided by Addressables). The AudioListener is attached to a camera in a DontDestroy state. Considering that this setup worked previously, the cause of the current issue is unclear. For scene loading and unloading: Loading: Addressables.LoadSceneAsync(resourceName, LoadSceneMode.Additive, true); Unloading: Addressables.UnloadSceneAsync(sceneInstance); We are managing the code flow using async/await. Could you provide any advice or solutions for this issue? Thank you.
2
0
882
Jan ’24