speechsynthesizer

SpeechSynthesizer in ASP.NET - async error

帅比萌擦擦* 提交于 2019-12-06 04:42:13
I would like to be able to generate speech in my ASP.NET app by calling speak.aspx?text=Hello%20world . This would give a response in .wav format. So far I have a blank page with code behind: protected void Page_PreRender(object sender, EventArgs e) { using (var ss = new SpeechSynthesizer()) { MemoryStream str = new MemoryStream(); ss.SetOutputToWaveStream(str); ss.Speak(Server.UrlDecode(Request.QueryString["text"])); Response.AddHeader("Content-Type", "audio/wav"); str.WriteTo(Response.OutputStream); str.Close(); } } However this fails with message: InvalidOperationException : Asynchronous

Is there any japanese TTS voice to work with C# SpeechSynthesizer

回眸只為那壹抹淺笑 提交于 2019-12-04 14:49:31
Is there any Japanese voice for C#'s SpeechSynthesizer TTS? If so please state detailed information about it, better if documentation provided. Thanks in advance. Microsoft's Agent had a set of free voices including Japanese based on the L&H TTS3000 engine. The engines were SAPI 4 compatible. Unfortunately the Microsoft Agent site seems to be unavailable at the moment Microsoft has a list of third-party TTS engines here . In particular, NeoSpeech has a Japanese TTS engine. Also, apparently Japanese MS Office 2003 ships with a Japanese TTS engine , but I don't have first-hand knowledge of this.

Ultra Fast Text to Speech (WAV -> MP3) in ASP.NET MVC

时间秒杀一切 提交于 2019-12-03 03:47:20
This question is essentially about the suitability of Microsoft's Speech API (SAPI) for server workloads and whether it can be used reliably inside of w3wp for speech synthesis. We have an asynchronous controller that uses uses the native System.Speech assembly in .NET 4 (not the Microsoft.Speech one that ships as part of Microsoft Speech Platform - Runtime Version 11) and lame.exe to generate mp3s as follows: [CacheFilter] public void ListenAsync(string url) { string fileName = string.Format(@"C:\test\{0}.wav", Guid.NewGuid()); try { var t = new System.Threading.Thread(() => { using

Are the SpeakProgressEventArgs of the SpeechSynthesizer inaccurate?

时光总嘲笑我的痴心妄想 提交于 2019-12-01 17:41:20
Using the System.Speech.Synthesis.SpeechSynthesizer class in .Net 3.5, the AudioPosition property of the SpeakProgressEventArgs appears to be inaccurate. The following code produces the following output: Code: using System; using System.Speech.Synthesis; using System.Threading; namespace SpeechTest { class Program { static ManualResetEvent speechDoneEvent = new ManualResetEvent(false); static void Main(string[] args) { SpeechSynthesizer synthesizer = new SpeechSynthesizer(); synthesizer.SpeakProgress += new EventHandler<SpeakProgressEventArgs>(synthesizer_SpeakProgress); synthesizer

TTS to Stream with SpeechAudioFormatInfo using SpeechSynthesizer

我是研究僧i 提交于 2019-11-29 09:27:40
问题 I am using System.Speech.Synthesis.SpeechSynthesizer to convert text to speech. And due to Microsoft's anemic documentation (see my link, there's no remarks or code examples) I'm having trouble making heads or tails of the difference between two methods: SetOutputToAudioStream and SetOutputToWaveStream. Here's what I have deduced: SetOutputToAudioStream takes a stream and a SpeechAudioFormatInfo instance that defines the format of the wave file (samples per second, bits per second, audio

SpeechSynthesizer.SelectVoice() Fails with “No matching voice is installed or the voice was disabled”

人走茶凉 提交于 2019-11-28 13:03:39
I am modifying Scott Hanselman 's BabySmash code to support other languages. I installed the speech platform and a new language per these steps . The language now shows up in the registry: The language can now be selected and played by Windows: System.Speech.Synthesis.SpeechSynthesizer.GetInstalledVoices() now returns the voice. However SelectVoice() in the code below throws the error "System.ArgumentException: Cannot set voice. No matching voice is installed or the voice was disabled." string phrase = null; SpeechSynthesizer speech = new SpeechSynthesizer(); CultureInfo keyboardCulture =

C# SpeechSynthesizer makes service unresponsive

只谈情不闲聊 提交于 2019-11-27 07:47:53
问题 I have the folowing code [WebMethod] public byte[] stringToWav(string text) { SpeechSynthesizer ss = new SpeechSynthesizer(); MemoryStream ms = new MemoryStream(); ss.SetOutputToWaveStream(ms); ss.Speak(text); return ms.ToArray(); } and the service returns nothing. Any idea why this happens? 回答1: I ran into the same exact problem with an ashx page. I don't understand exactly why, but it seems that you need to use a separate thread and wait for it to complete. The following code worked for me: