问题
I have incorporated text to speech in an asp.net webforms application which works fine when running locally. When I deploy to azure websites however it looks like a null reference is happening dealing with System.Speech.
I have tried to publish the webforms app to azure with the "Copy Local" as true on System.Speech .dll however the issue still persists.
Is there anything I am missing to get System.Speech to work on azure websites?
I have researched and found posts from a while back saying it wasn't supported but I am hoping this may of changed overtime. I will need to find some third-party TTS service if this is the case.
回答1:
System.Speech is a desktop API, and definitely isn't supported on server systems. Microsoft.Speech.Synthesis is a server API and is supported on (standalone) servers. However, I'm not sure if it's possible to deploy this on Azure websites, as it requires extensive updates to the installed software (for voices, etc.).
回答2:
Since azure cannot support this I found this as a valid work around.
http://translatorservice.codeplex.com/
It uses the Microsoft Translator Service.
来源:https://stackoverflow.com/questions/22230426/how-to-get-system-speech-on-windows-azure-websites