• Jobs
  • About Us
  • professionals
    • Home
    • Jobs
    • Courses and challenges
  • business
    • Home
    • Post vacancy
    • Our process
    • Pricing
    • Assessments
    • Payroll
    • Blog
    • Sales
    • Salary Calculator

0

124
Views
no se puede establecer el valor para el nuevo objeto SpeechSynthesisUtterance

Tengo una función llamada TexttoSpeech que se llama cuando se vuelve a cargar la página. El problema es que no puedo establecer el valor en msg.text usando DOM. Puedo ver el texto en la consola pero no puedo asignar el valor a msg.text . el document.getElementById("text").innerHTML tiene una longitud de 1133

 function TexttoSpeech() { var msg = new SpeechSynthesisUtterance(); var voices = window.speechSynthesis.getVoices(); msg.voice = voices[7]; msg.volume = 1; // From 0 to 1 msg.rate = 1; // From 0.1 to 10 msg.pitch = 2; // From 0 to 2 msg.text = document.getElementById("text").innerHTML msg.lang = "es"; window.speechSynthesis.speak(msg); } if (performance.navigation.type == performance.navigation.TYPE_RELOAD) { TexttoSpeech(); redirectToNextPage(); //If the page reload this function is called }
about 3 years ago · Juan Pablo Isaza
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Our process Sales
Legal
Terms and conditions Privacy policy
© 2025 PeakU Inc. All Rights Reserved.

Andres GPT

Recommend me some offers
I have an error