Post

Replies

Boosts

Views

Activity

Swift: Crash when the timer of the Apple clock App goes off
Is there a way to determine when the timer of the Apple clock App goes off? With my App you can use a metronome to practice a musical instrument. Unfortunately the App crashes if the metronome is on and the timer of the Apple clock App goes off. The metronome uses Grand Central Dispatch queue and I think this causes the crash. So the easiest way would be to stop the metronome and all other audio before the Apple timer notification appears on the top of screen to prevent that crash. Currently I use AVAudioSession.interruptionNotification to stop the metronome. This works in some cases but not every time. There seem to be different errors in the console: 2020-09-13 17:12:06.918642+0200 myApp[5256:2023719] [avae]      AVAEInternal.h:76  required condition is false: [AVAudioPlayerNode.mm:570:StartImpl: (engine->IsRunning())] 2020-09-13 17:12:06.925411+0200 myApp[5256:2023719] * Terminating app due to uncaught exception 'com.apple.coreaudio.avfaudio', reason: 'required condition is false: engine->IsRunning()' First throw call stack: (0x1a26ce114 0x1b5e84cb4 0x1a25dd308 0x1b1b1acb8 0x1b1bce93c 0x1b1bcbc38 0x100dc362c 0x100c61c68 0x100c604e4 0x100af6e58 0x1015195fc 0x10151c2a0 0x10152fb64 0x10152b120 0x10152ba48 0x1e70a8568 0x1e70ab874) libc++abi.dylib: terminating with uncaught exception of type NSException Terminating app due to uncaught exception 'com.apple.coreaudio.avfaudio', reason: 'required condition is false: engine->IsRunning()' terminating with uncaught exception of type NSException 2. 2020-09-13 17:09:15.395980+0200 myApp[5235:2022412] [aurioc] 1594: AUIOClientStartIO failed (560557684) Audio Interruption Beginn 2020-09-13 17:09:15.404079+0200 myApp[5235:2022412] [avae]      AVAEInternal.h:109 [AVAudioEngineGraph.mm:1545:Start: (err = PerformCommand(*ioNode, kAUStartIO, NULL, 0)): error 560557684
2
0
838
Sep ’20