speech-synthesis

SpeechSynthesis stops working after first utterance in FireFox, but works in Chrome

妖精的绣舞 提交于 2020-01-06 05:34:25
问题 The problem is very simple, see JSfiddle. SpeechSynthesis works fine in Chrome, but mysteriously stops after the first utterance in FireFox. (Works for me in Safari as well.) Any ideas welcome, as I don't have much to go by. The code: var u = new SpeechSynthesisUtterance(); var synth = window.speechSynthesis; u.text = "hello"; synth.speak(u); synth.speak(u); synth.speak(u); 回答1: This is actually a known bug in Firefox. The specs drafts are still not very clear about the re-usability of an

C++ MSAPI 5: SetNotifyCallbackFunction not working

随声附和 提交于 2019-12-29 08:45:08
问题 So I've tried the MSAPI 5.4 TTS with event example. Now I create an cmd prompt app that utilize the SetNotifyCallbackFunction but the function that I've pass is not being called. I'm not an expert in C++ so I am having difficulty in solving this one, can anyone point me in the right direction or at least give me a good example of SetNotifyCallbackFunction? Here is a simplified version of my code: typedef void __stdcall SPNOTIFYCALLBACK(WPARAM wParam, LPARAM lParam); void __stdcall

Android Text-To-Speech API Sounds Robotic

℡╲_俬逩灬. 提交于 2019-12-28 12:33:26
问题 I'm learning android development for the first time and my goal is to create a simple Hello World application that takes in some text, and reads them out loud. I've based my code off an example I found and here's my code: class MainFeeds : AppCompatActivity() { override fun onCreate(savedInstanceState: Bundle?) { super.onCreate(savedInstanceState) setContentView(R.layout.activity_main_feeds) card.setOnClickListener{ Toast.makeText(this, "Hello", Toast.LENGTH_LONG).show() TTS(this, "Hello this

Android Text-To-Speech API Sounds Robotic

最后都变了- 提交于 2019-12-28 12:33:10
问题 I'm learning android development for the first time and my goal is to create a simple Hello World application that takes in some text, and reads them out loud. I've based my code off an example I found and here's my code: class MainFeeds : AppCompatActivity() { override fun onCreate(savedInstanceState: Bundle?) { super.onCreate(savedInstanceState) setContentView(R.layout.activity_main_feeds) card.setOnClickListener{ Toast.makeText(this, "Hello", Toast.LENGTH_LONG).show() TTS(this, "Hello this

Text-to-speech (voice generation) and speech-to-text (voice recognition) APIs?

陌路散爱 提交于 2019-12-27 11:05:07
问题 Is there a comprehensive list of known APIs for desktop or browser environments? 回答1: I'll rehash and update an answer from Speech recognition in C or Java or PHP?. This is by no means comprehensive, but it might be a start for you From watching these questions for few months, I've seen most developer choices break down like this: Windows folks - use the System.Speech features of .Net or Microsoft.Speech and install the free recognizers Microsoft provides. Windows 7 includes a full speech

Text to Speech in Window Store App

 ̄綄美尐妖づ 提交于 2019-12-25 02:03:52
问题 In my application I am using Text 2 Speech using SpeechSynthesizer.In my code it is speaking with only 3 voices ( One male and two females).My application is for kids so i want voice just like kids how can i achieve that? CODE: var synth = new SpeechSynthesizer(); foreach (var voice in SpeechSynthesizer.AllVoices) { synth.Voice = voice; var text = "Hello World"; var stream = await synth.SynthesizeTextToStreamAsync(text); var me = new MediaElement(); me.SetSource(stream, stream.ContentType);

speechSynthesis API example gives error

浪尽此生 提交于 2019-12-24 13:19:11
问题 The example given on Web Speech API Specification speechSynthesis.speak(SpeechSynthesisUtterance('Hello World')); gives the following error on chrome: Uncaught TypeError: DOM object constructor cannot be called as a function. Can anyone help here? Thanks! 回答1: I think there is a type in the specifications and you are expected to use the new keyword with the SpeechSynthesisUtterance object. Try this: speechSynthesis.speak(new SpeechSynthesisUtterance('Hello World')); 回答2: Here's some code and

Female voice in google chrome speechSynthesis

ε祈祈猫儿з 提交于 2019-12-24 10:59:47
问题 Im using this exact code in both the scenarios. var msg = new SpeechSynthesisUtterance(); var voices = window.speechSynthesis.getVoices(); msg.voice = voices[1]; msg.text = "hello world"; msg.lang = 'en-US'; speechSynthesis.speak(msg); If I run this in the chrome console I get a female voice. But if I put the exact code in an index.html and run it, it plays a male voice. Could any one please clarify why this difference occurs. Thanks in advance. 回答1: Found the Root cause. Getting the list of

voiceschanged event not fired in Safari

醉酒当歌 提交于 2019-12-24 04:57:29
问题 As far as I can tell, the voiceschanged event doesn't fire in Safari, either on macs or in iOS. Also odd, it doesn't seem to fire in Chrome on iOS either, but I'm assuming Chrome on iOS uses the same JavaScript engine as Safari. Here's a demonstration that I used to verify: http://jsbin.com/gosaqihi/9/edit?js,console (taken from Getting the list of voices in speechSynthesis of Chrome (Web Speech API)) I've also tried it using addEventListener: speechSynthesis.addEventListener("voiceschanged",

SpeechRecognition and SpeechSynthesis in TypeScript

孤人 提交于 2019-12-23 19:23:39
问题 I was able to run SpeechRecognition in TypeScript by creating interface as below, and it is working fine: namespace CORE{ export interface IWindow extends Window{ webkitSpeechRecognition: any; } } I tried to use the same way for SpeechSynthesis, but field, and the below code did not work: namespace CORE{ export interface IWindow extends Window{ SpeechSynthesisUtterance: any; speechSynthesis: any; } } my questions are: Is the way i used to define the SpeechRecognition is the best practice to