Skip to content

Commit

Permalink
fix filter for #93
Browse files Browse the repository at this point in the history
  • Loading branch information
jessegreenberg committed Nov 9, 2022
1 parent eef67e4 commit d734eb0
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion js/SpeechSynthesisAnnouncer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -477,7 +477,13 @@ class SpeechSynthesisAnnouncer extends Announcer {
const allVoices = this.voices.slice();

// exclude "novelty" voices that are included by the operating system but marked as English.
const voicesWithoutNovelty = _.filter( allVoices, voice => !NOVELTY_VOICES.includes( voice.name ) );
// const voicesWithoutNovelty = _.filter( allVoices, voice => !NOVELTY_VOICES.includes( voice.name ) );
const voicesWithoutNovelty = _.filter( allVoices, voice => {

// Remove the voice if the SpeechSynthesisVoice.name includes a substring of the entry in our list (the browser
// might include more information in the name than we maintain, like locale info or something else).
return !_.some( NOVELTY_VOICES, noveltyVoice => voice.name.includes( noveltyVoice ) );
} );

const getIndex = ( voice: SpeechSynthesisVoice ) =>
voice.name.includes( 'Google' ) ? -1 : // Google should move toward the front
Expand Down

0 comments on commit d734eb0

Please sign in to comment.