Skip to content

Commit 0b5cecc

Browse files
committed
Try to avoid extra synth timeouts
1 parent 0b0458d commit 0b5cecc

1 file changed

Lines changed: 6 additions & 0 deletions

File tree

SSAccessibility/SSSpeechSynthesizer.m

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,11 @@ - (void)enqueueLineForSpeaking:(NSString *)line {
8484
}
8585

8686
dispatch_async(dispatch_get_main_queue(), ^{
87+
if (self.speakResetTimer) {
88+
[self.speakResetTimer invalidate];
89+
_speakResetTimer = nil;
90+
}
91+
8792
[self.speechQueue addObject:line];
8893
[self _maybeDequeueLine];
8994
});
@@ -155,6 +160,7 @@ - (void)voiceOverDidFinishAnnouncing:(NSNotification *)note {
155160

156161
if (self.speakResetTimer) {
157162
[self.speakResetTimer invalidate];
163+
_speakResetTimer = nil;
158164
}
159165

160166
NSDictionary *userInfo = [note userInfo];

0 commit comments

Comments
 (0)