I have an ARKit app that plays sounds using playaudio
when the app moves to the background i get the following :
AURemoteIO.cpp:1590:Start: AUIOClientStartIO failed (561015905)
AVAEInternal.h:109 [AVAudioEngineGraph.mm:1544:Start: (err = PerformCommand(*ioNode, kAUStartIO, NULL, 0)): error 561015905
when it comes back to the foreground and a sound is played it crashes and i get the following:
[avae] AVAEInternal.h:76 required condition is false: [AVAudioPlayerNode.mm:712:ScheduleBuffer: (outputFormat.channelCount == buffer.format.channelCount)]
in crash logs the crash is happening here :
AVAudioFileImpl::CheckClientFormatSet() + 60
tried fixes:
Code Block let audioPlay = SCNAction.playAudio(audioSource!, waitForCompletion: false)
when the app moves to the background i get the following :
AURemoteIO.cpp:1590:Start: AUIOClientStartIO failed (561015905)
AVAEInternal.h:109 [AVAudioEngineGraph.mm:1544:Start: (err = PerformCommand(*ioNode, kAUStartIO, NULL, 0)): error 561015905
when it comes back to the foreground and a sound is played it crashes and i get the following:
[avae] AVAEInternal.h:76 required condition is false: [AVAudioPlayerNode.mm:712:ScheduleBuffer: (outputFormat.channelCount == buffer.format.channelCount)]
in crash logs the crash is happening here :
AVAudioFileImpl::CheckClientFormatSet() + 60
tried fixes:
Enable background audio works but my app does not have any logical use for background audio
self.sceneView.audioEngine.mainMixerNode.outputVolume = 0.0 when app moves to background. still crashes but less often
Is there some solution about this issue?
I have tried to add following code to AppDelegate, it solves the issue but sounds continue playing when app runs in the background.
let audioSession = AVAudioSession.sharedInstance()
do {
// Set the audio session category, mode, and options.
try audioSession.setCategory(.playback, mode: .moviePlayback, options: [])
} catch {
print("Failed to set audio session category.")
}
I have tried to add following code to AppDelegate, it solves the issue but sounds continue playing when app runs in the background.
let audioSession = AVAudioSession.sharedInstance()
do {
// Set the audio session category, mode, and options.
try audioSession.setCategory(.playback, mode: .moviePlayback, options: [])
} catch {
print("Failed to set audio session category.")
}