No audio is heard by the player during gameplay

Hello. I would like to share my situation in hopes that it might help others in the same boat.

I am building an app that switches between Bounded and Unbounded scenes, and I am encountering a similar issue. The audio works fine right after the build, but when I detach the app from Xcode and run it again, the sound does not play.

I was very interested in the solution suggested earlier, but unfortunately, it doesn’t fit my use case as it involves using something other than the default volume camera during scene transitions.

I also tried implementing this method, but the required settings are different for Bounded and Unbounded scenes (Bounded: Bypass, Unbounded: HeadTracked), which doesn’t suit my needs.

Additionally, I attempted to use this method to call Swift functions from Unity during scene transitions, but it didn’t work as expected. It seems the settings might be overwritten when executed. Following codes are samples of Swift functions:

// Declared in C# as: static extern void SetupSpatialAudioSessionBypass();
@_cdecl("SetupSpatialAudioSessionBypass")
func setupSpatialAudioSessionBypass()
{
    print("SETUP SPATIAL AUDIO BYPASS")
    do {
        let session = AVAudioSession.sharedInstance()
        try session.setIntendedSpatialExperience(.bypassed)
    } catch {
        fatalError("Failed to reconfigure active shared session.")
    }
}

// Declared in C# as: static extern void SetupSpatialAudioSessionHeadTracked();
@_cdecl("SetupSpatialAudioSessionHeadTracked")
func setupSpatialAudioSessionHeadTracked()
{
    print("SETUP SPATIAL AUDIO HEAD TRACKED")
    do {
        let session = AVAudioSession.sharedInstance()
        try session.setIntendedSpatialExperience(
            .headTracked(soundStageSize: .medium, anchoringStrategy: .front)
        )
    } catch {
        fatalError("Failed to reconfigure active shared session.")
    }
}

For reference, I am using PolySpatial 1.2.3.