Skip to content
Permalink
Browse files
AX: WebSpeech only allows use of selected voices.
https://bugs.webkit.org/show_bug.cgi?id=242588

Reviewed by Andres Gonzalez.

The logic for selecting a voice was ignoring if the a voice had been set already.
No great way to test this since it's about choosing the voice that goes into the synthesizer and there's not a callback for that.

* Source/WebCore/platform/cocoa/PlatformSpeechSynthesizerCocoa.mm:
(-[WebSpeechSynthesisWrapper speakUtterance:]):

Canonical link: https://commits.webkit.org/252346@main
  • Loading branch information
fleizach committed Jul 11, 2022
1 parent 38a3461 commit b952f39f7f29c7e4b84a6916e0b05c51f4d6a953
Showing 1 changed file with 4 additions and 1 deletion.
@@ -132,7 +132,10 @@ - (void)speakUtterance:(RefPtr<WebCore::PlatformSpeechSynthesisUtterance>&&)utte
voiceLanguage = utterance->voice()->lang();

AVSpeechSynthesisVoice *avVoice = nil;
if (voiceLanguage)
if (utteranceVoice)
avVoice = [PAL::getAVSpeechSynthesisVoiceClass() voiceWithIdentifier:utteranceVoice->voiceURI()];

if (!avVoice)
avVoice = [PAL::getAVSpeechSynthesisVoiceClass() voiceWithLanguage:voiceLanguage];

AVSpeechUtterance *avUtterance = [PAL::getAVSpeechUtteranceClass() speechUtteranceWithString:utterance->text()];

0 comments on commit b952f39

Please sign in to comment.