leaonline / easy-speech

🔊 Cross browser Speech Synthesis also known as Text to speech or TTS; no dependencies; uses Web Speech API
https://leaonline.github.io/easy-speech/
189 stars 21 forks source link

Any voices with "(natual)" fail to be used to speak #242

Closed MRYingLEE closed 8 months ago

MRYingLEE commented 9 months ago

Describe the bug Any voices with "(natual)" fail to be used to speak

To Reproduce Steps to reproduce the behavior: In your online demo, try to pick up any voice with "(natual)", such as "Maisie". Then nothing is spoke out while other non-natual voices work.

I tested on Microsoft Edge v.121.

Expected behavior All voices can be used.

Desktop (please complete the following information):

I tried to following


// Get the voices available 
const voices = window.speechSynthesis.getVoices();

const textToSpeak = "This project was created, because it's always a struggle to get the synthesis part of Web Speech API running on most major browsers.";
// Create a new SpeechSynthesisUtterance object
const utterance = new SpeechSynthesisUtterance(textToSpeak);
// Find the voice that includes "Maise"
let maiseVoice = voices.find(voice => voice.name.includes("Maisie"));

if (maiseVoice === undefined)
  maiseVoice=voices[0];
// Set the voice and other parameters
utterance.voice = maiseVoice; // Use the first voice available
utterance.pitch = 1;
utterance.rate = 1; 

// Speak the text
window.speechSynthesis.speak(utterance);

in https://playcode.io/1699188. The voice works well.

So this must be a new bug for a few months ago every voice worked.

jankapunkt commented 9 months ago

Thank you @MRYingLEE for reporting this. Is there any notable output in the debug log panel in the Demo page when attempting to play these voices?

MRYingLEE commented 9 months ago

For "Maisie", the debug log is as the following: is android: false is firefox: false is safari: false init: start is android: false is firefox: false is safari: false init: voices init: voices (onvoiceschanged) voices loaded: 312 init: complete find unique languages... found 74 languages populate languages to select component attach events, cleanup voices loaded: 312 init speak utterance: voice=Microsoft Elimu Online (Natural) - English (Tanzania) volume=1 rate=1 pitch=1 event: start resumeInfinity isSpeaking=true isPaused=false event: end speak complete init speak utterance: voice=Microsoft Elimu Online (Natural) - English (Tanzania) volume=1 rate=1 pitch=1 event: start resumeInfinity isSpeaking=true isPaused=false event: end speak complete init speak utterance: voice=Microsoft Elimu Online (Natural) - English (Tanzania) volume=1 rate=1 pitch=1 event: start resumeInfinity isSpeaking=true isPaused=false event: end speak complete init speak utterance: voice=Microsoft Elimu Online (Natural) - English (Tanzania) volume=1 rate=1 pitch=1 event: start resumeInfinity isSpeaking=true isPaused=false event: end speak complete init speak utterance: voice=Microsoft George - English (United Kingdom) volume=1 rate=1 pitch=1 event: start resumeInfinity isSpeaking=true isPaused=false event: boundary event: boundary event: boundary event: boundary event: boundary event: boundary event: boundary event: boundary event: boundary event: boundary event: boundary event: boundary event: boundary event: boundary event: boundary event: boundary event: boundary resumeInfinity isSpeaking=true isPaused=false event: boundary event: boundary event: boundary event: boundary event: boundary event: boundary event: boundary event: end speak complete init speak utterance: voice=Microsoft Maisie Online (Natural) - English (United Kingdom) volume=1 rate=1 pitch=1 event: start resumeInfinity isSpeaking=true isPaused=false event: end speak complete init speak utterance: voice=Microsoft Maisie Online (Natural) - English (United Kingdom) volume=1 rate=1 pitch=1 event: start resumeInfinity isSpeaking=true isPaused=false event: end speak complete

===================================== For Microsoft George - English (United Kingdom), the debug log is as the following:

DEBUG LOG is android: false is firefox: false is safari: false init: start is android: false is firefox: false is safari: false init: voices init: voices (onvoiceschanged) voices loaded: 312 init: complete find unique languages... found 74 languages populate languages to select component attach events, cleanup voices loaded: 312 init speak utterance: voice=Microsoft Elimu Online (Natural) - English (Tanzania) volume=1 rate=1 pitch=1 event: start resumeInfinity isSpeaking=true isPaused=false event: end speak complete init speak utterance: voice=Microsoft Elimu Online (Natural) - English (Tanzania) volume=1 rate=1 pitch=1 event: start resumeInfinity isSpeaking=true isPaused=false event: end speak complete init speak utterance: voice=Microsoft Elimu Online (Natural) - English (Tanzania) volume=1 rate=1 pitch=1 event: start resumeInfinity isSpeaking=true isPaused=false event: end speak complete init speak utterance: voice=Microsoft Elimu Online (Natural) - English (Tanzania) volume=1 rate=1 pitch=1 event: start resumeInfinity isSpeaking=true isPaused=false event: end speak complete init speak utterance: voice=Microsoft George - English (United Kingdom) volume=1 rate=1 pitch=1 event: start resumeInfinity isSpeaking=true isPaused=false event: boundary event: boundary event: boundary event: boundary event: boundary event: boundary event: boundary event: boundary event: boundary event: boundary event: boundary event: boundary event: boundary event: boundary event: boundary event: boundary event: boundary resumeInfinity isSpeaking=true isPaused=false event: boundary event: boundary event: boundary event: boundary event: boundary event: boundary event: boundary event: end speak complete init speak utterance: voice=Microsoft Maisie Online (Natural) - English (United Kingdom) volume=1 rate=1 pitch=1 event: start resumeInfinity isSpeaking=true isPaused=false event: end speak complete init speak utterance: voice=Microsoft Maisie Online (Natural) - English (United Kingdom) volume=1 rate=1 pitch=1 event: start resumeInfinity isSpeaking=true isPaused=false event: end speak complete init speak utterance: voice=Microsoft George - English (United Kingdom) volume=1 rate=1 pitch=1 event: start resumeInfinity isSpeaking=true isPaused=false event: boundary event: boundary event: boundary event: boundary event: boundary event: boundary event: boundary event: boundary event: boundary event: boundary event: boundary event: boundary event: boundary event: boundary event: boundary event: boundary event: boundary event: boundary resumeInfinity isSpeaking=true isPaused=false event: boundary event: boundary event: boundary event: boundary event: boundary event: boundary event: end speak complete

jankapunkt commented 9 months ago

I can confirm this, however I can't find the root cause, I need more investigation on this, especially since there is a setup that works.

jankapunkt commented 8 months ago

@MRYingLEE coming back to this I found the root cause and fixed it in #254

Please do the following:

if it's not working:

Finally:

MRYingLEE commented 8 months ago

The issue has gone with the new version. Thanks.