speech-synthesis

How do I add a voice / language to speechSynthesis?

百般思念 提交于 2019-12-06 03:48:41
When I run speechSynthesis.getVoices() in Chrome, I get a list of possible voices. The list changes depending on the computer and version of Chrome. Is there any way I can extend support and add more voices? I feel like this could be done by asking a user to download a voice file for their chosen language. Do such files exist? Edit: This needs to work for both Windows and Mac computers. It also needs to be simple, so no scripts or anything that would require extensive technical knowledge. I'm hoping for a "download and install" type of thing HOW TO ADD MORE VOICE FROM MICROSOFT EDGE TO CHROME

Speech Synthesis API Highlight words as they are spoken

蹲街弑〆低调 提交于 2019-12-06 02:04:58
问题 Currently, I'm making a simple app where text is spoken using the speech synthesis API. I want to highlight the words (bold) as they are being spoken. I currently have a very basic implementation doing this using the 'onboundary' event. However, I'm wondering if there's a better/nicer way of doing it, as my implementation is based on a few presumptions. var words; var wordIdx; var text; var utterance = new SpeechSynthesisUtterance(); utterance.lang = 'en-UK'; utterance.rate = 1; window.onload

JS Speech Synthesis Issue on iOS

空扰寡人 提交于 2019-12-05 11:21:14
I recently implemented a basic web app which relied on Google's TTS URL to generate clear MP3 files for playback on the front end. This has since been subject to an additional security check, meaning I have had to update the code base to use alternative methods. One such alternative is javascript's speech synthesis API, i.e. SpeechSynthesisUtterance() and window.speechSynthesis.speak('...'). This works really well on my desktop and laptop but as soon as I use it on my iOS devices, the rate of the audio is accelerated significantly. Can anyone suggest what I can do to resolve this? See below

Memory leak in .Net Speech.Synthesizer?

柔情痞子 提交于 2019-12-05 04:39:47
I found a continuous leakage in my application. After examining using a memory profiler, I found the course is some object from Microsoft Speech.Synthesizer So I build up a toy project to verify the hypothesis: //Toy example to show memory leak in Speech.Synthesizer object static void Main(string[] args) { string text = "hello world. This is a long sentence"; PromptBuilder pb = new PromptBuilder(); pb.StartStyle(new PromptStyle(PromptRate.ExtraFast)); pb.AppendText(text); pb.EndStyle(); SpeechSynthesizer tts = new SpeechSynthesizer(); while (true) { //SpeechSynthesizer tts = new

System.Speech.Synthesis hangs with high CPU on 2012 R2

☆樱花仙子☆ 提交于 2019-12-04 22:51:54
I have an asp.net MVC application that has a controller action that takes a string as input and sends a response wav file of the synthesized speech. Here is a simplified example: public async Task<ActionResult> Speak(string text) { Task<FileContentResult> task = Task.Run(() => { using (var synth = new System.Speech.Synthesis.SpeechSynthesizer()) using (var stream = new MemoryStream()) { synth.SetOutputToWaveStream(stream); synth.Speak(text); var bytes = stream.GetBuffer(); return File(bytes, "audio/x-wav"); } }); return await task; } The application (and this action method in particular) is

The right way to use SSML with Web Speech API

北城余情 提交于 2019-12-04 18:03:09
问题 Web Speech API specification says: text attribute This attribute specifies the text to be synthesized and spoken for this utterance. This may be either plain text or a complete, well-formed SSML document. For speech synthesis engines that do not support SSML, or only support certain tags, the user agent or speech engine must strip away the tags they do not support and speak the text. It does not provide an example of using text with an SSML document. I tried the following in Chrome 33: var

Why does a SpeechSynthesisUtterance sometimes not fire an 'end' event in Chromium-based browsers?

帅比萌擦擦* 提交于 2019-12-04 16:54:51
问题 In both Chrome (v72, W10) and Opera, the following snippet very occasionally does not seem to run the attached end listener to the SpeechSynthesisUtterance , maybe 1 out of 50 times the snippet is run. (Sorry, in the original version of this, it could be reproduced much more easily - now, creating the utterance on button click looks to have made the bug much more rare) button.onclick = () => { console.log('start script'); button.disabled = true; const utt = new SpeechSynthesisUtterance('e');

How to access audio result from Speech Synthesis API?

蓝咒 提交于 2019-12-04 11:40:37
问题 The Speech Synthesis API allows text-to-speech functionality in Chrome Beta. However, results from TTS requests are automatically played by the browser. How do I access the audio results for post-processing and disable the default behavior of the API? 回答1: There is no standard audio output for the TTS system and that seems quite intentional so it is unlikely to change anytime soon. To understand why, you can look at the other side of this interface where a browser extension can act as a TTS

HTML5 Web Speech API not working locally

ぐ巨炮叔叔 提交于 2019-12-04 07:20:36
I am trying to make this code work and don't know why is it not working locally. I tried the same on CodePen.io and it works. <html> <head> <title>Voice API</title> </head> <body> <button onClick="func()">Click Me</button> <script> function func() { alert('Hello'); var recognition = new webkitSpeechRecognition(); recognition.continuous = true; recognition.interimResults = true; recognition.onresult = function(event) { alert(event.results[0][0].transcript); } recognition.start(); } </script> </body> Any suggestions? Code Uniquely You could try adding the following snippet to see what error is

Speech Synthesis API Supported Languages

痞子三分冷 提交于 2019-12-04 06:43:45
问题 does anybody have a list on the languages which Speech Synthesis API supports? Or a snippet of code I could run to find the different languages? Thanks! 回答1: The list of supported voices is different for each browser/OS combination. I wrote a jsbin showing the voices of the browser/OS on which it's run: https://jsbin.com/ginanegoqu/edit?js,output if ('speechSynthesis' in window) { // Start an html table for languages details var text = '<table border=1><tr><th>Default<th>Language<th>Local<th