question

marcantoineyonga-1329 avatar image
0 Votes"
marcantoineyonga-1329 asked Ivan-8465 published

problem of running speechSynthetiser on aspx page

Hello,

I've got a problem of running System.Speech.Synthesis.SpeechSynthetiser on aspx page. on a computer with windows 10 installation the control is operationnal but on a server with windows vista the same program with the same aspx and aspx.cs pages, the control is not operational. the page running on a site IIS (http://testpro0.jicixipi.net). I put the option Async to true to the page but the loading of page is blocking or there is no sound output.

code :
SpeechSynthesizer synthesizer = new SpeechSynthesizer();
synthesizer.SetOutputToDefaultAudioDevice();
synthesizer.Volume = 100;
synthesizer.Speak("Hello World");
//synthesizer.SpeakAsync("bonjour tout le monde, comment allez vous ? êtes vous partie pour une nouvelle partie de bon et joyeux coeur.");


Thanks you for your solution.

Marc-Antoine

azure-speechdotnet-aspnet-webforms
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

LanHuang-MSFT avatar image
0 Votes"
LanHuang-MSFT answered

Hi @marcantoineyonga-1329,
If it is not asynchronous when setting Async = true, then it will be blocked.
For how to use asynchronous methods, you can refer to:
https://docs.microsoft.com/en-us/aspnet/web-forms/overview/performance-and-caching/using-asynchronous-methods-in-aspnet-45
Besides, the ASP.NET application can’t have the sufficient permission to access Speech Synthesis.
They are only useful on the OS which is hosting the application. In Request/ Response architecture(as web is) you can only write something to the browser and nothing much.
While in testing, the server and client are the same, if you got this to work and deployed it as a site, the C# code, running on the server, would cause the server to speak,and not the client machine. Please note this.
Best regards,
Lan Huang


If the answer is the right solution, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".
Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.

5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

AgaveJoe avatar image
0 Votes"
AgaveJoe answered marcantoineyonga-1329 edited

The code behind runs on the web server not the client machine. the design seems to work as expected during development because your development machine is both the server and the client. Once deployed to the actual web server only people in server room can hear the sounds - only if the server has speakers and a sound card.

· 1
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

Hello,

Wich method or code could I used to hear sounds of Speech.Synthetiser to the client machine !? in add of this, the problem is that the loading of page is blocking.

0 Votes 0 ·
marcantoineyonga-1329 avatar image
0 Votes"
marcantoineyonga-1329 answered

hello,

finaly, i research on the net and i'm trying to used speechsynthesis of or by javascript. it's interessant by the client beside.

truly yours.

5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

Ivan-8465 avatar image
0 Votes"
Ivan-8465 answered Ivan-8465 published

hello, I had a lot of time spent with text-to-speech in c#. I know about Microsoft-Agent, and am sure it can run in browser (at least in Internet Explorer). Though, it is kind of old technology, and not really much supported now. Instead, there is the project doubleagent.sourceforge.net - DoubleAgent, which fixes running issues on newver MS Windows OSes. So, if you want user to have text-to-speech on page, I'ld do this:
create .aspx page )WebForms project).
add there Double Agent (DLL), and probably drag-and-drop some component to aspx page (I didn't try, but hope it is similar to WinForms and should work).
place some button on aspx page. double click it and add function to activate that double agent (or maybe even ms-agent) on aspx page. if browser supports it (user controls like double agent in browser) it will show and run.
the issue here, problem is that some bad guys (hackers) used to misuse this feature of custom controls in aspx pages (like in general all those virus writers for web for whatever). so there can be some prblems to make it run in some browsers. but I think it should work at least for MS browser (now they call it edge). not sure about support for this for Chrome, Opera/Vivaldi, Firefox etc (maybe firefox is more advanced for this).
Also, I played with text-to-speech in Unity3d game engine. I used "FinalMarco text to speech". maybe it can also work for you, but for Unity TTS on web-page it maybe a bit uneasy to do. first try MSagent/DoubleAgent etc. if not enough you can add Unity3d TTS, but they also rely on common MS Win TTS features/DLLs

5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.