@apanda not really, unfortunately... didn't crash anymore while in foreground, but with app going in background (changing the AVAudioSession as inactive) when back in foreground (reactivating the AVAudioSession and speaking) the app crashes "more often". Think I might need to disable the "voice" functionalities in my app until this is fixed
Post
Replies
Boosts
Views
Activity
Faced the same issue and I implemented a workaround that so far seems working (still testing the app but didn't crash after letting "talk" for 20 hours).
Releasing a reallocating the AVSpeechSynthesizer every "x" time it speeches (after checking it is not speaking - that includes queued utterance, at least from my tests).
Hope this helps, waiting for a resolution of the bug.
Please comment here in case you still see crashes from the same bug.
- (void)speechSynthesizer:(AVSpeechSynthesizer *)synthesizer didFinishSpeechUtterance:(nonnull AVSpeechUtterance *)utterance
{
countVoiceAnnouced++;
// doing this to workaround apple bug - crashing after "x" speeches
if (countVoiceAnnouced > SPEECHES_BEFORE_RESETTING_BUG_APPLE && !voiceSynthesizer.isSpeaking)
{
voiceSynthesizer = nil;
voiceSynthesizer = [[AVSpeechSynthesizer alloc] init];
voiceSynthesizer.usesApplicationAudioSession = YES;
voiceSynthesizer.delegate = self;
countVoiceAnnouced = 0;
}
}