Skip to content

Commit

Permalink
Try to avoid extra synth timeouts
Browse files Browse the repository at this point in the history
  • Loading branch information
jhersh committed Feb 10, 2015
1 parent 0b0458d commit 0b5cecc
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions SSAccessibility/SSSpeechSynthesizer.m
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,11 @@ - (void)enqueueLineForSpeaking:(NSString *)line {
}

dispatch_async(dispatch_get_main_queue(), ^{
if (self.speakResetTimer) {
[self.speakResetTimer invalidate];
_speakResetTimer = nil;
}

[self.speechQueue addObject:line];
[self _maybeDequeueLine];
});
Expand Down Expand Up @@ -155,6 +160,7 @@ - (void)voiceOverDidFinishAnnouncing:(NSNotification *)note {

if (self.speakResetTimer) {
[self.speakResetTimer invalidate];
_speakResetTimer = nil;
}

NSDictionary *userInfo = [note userInfo];
Expand Down

0 comments on commit 0b5cecc

Please sign in to comment.