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;
}
}
Topic:
Machine Learning & AI
SubTopic:
General
Tags: