I'm using System.Speech.Synthesis from .NET 4.5.1 to generate a WAV file from a string in a Service run by a "specific user" (created by products setup) with no rights but running services and R/W access the folder containing the generated WAV file.
On a fresh win7sp1 x64 with all upgrades, calling methods like System.Speech.Synthesis.SelectVoice or System.Speech.Synthesis.Speak fails with InvalidOperationException
and message "No voice installed on the system or none available with the current security setting".
The only available voice in the system is the default one Microsoft Anna - English (United States)
.
If I run the service as LocalSystem
or Administrator
it works well.
If I add the "specific user" to the Administrators
group it works too, but not if I add it in any other "well known group".
But running the service with the "specific user" is mandatory (for other uses) and add it to the Administrators
group is excluded for security reasons.
Of course MSDN is very elusive about this and don't even mention the exception...
Googling around for a while I was surprised by the very few informations about it. In fact I found only one relevant clue in a Stackoverflow question about ASP.NET suggesting there are some minimal user rights to use this library : Creating a ASP.NET application converting text to speech
By default, ASP.Net applications don't run with sufficient permissions to access Speech Synthesis
I could also find some questions that are related to the same problem, but with no acceptable answers:
No voice installed on the system or none available with the current security setting
C# SpeechSynthesizer - "No voice installed on the system"
So do anyone know what permissions are required to use System.Speech.Synthesis
?