系统上未安装语音或当前安全设置无法使用 [英] No voice installed on the system or none available with the current security setting

查看:3421
本文介绍了系统上未安装语音或当前安全设置无法使用的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

IIS服务器上的异常当尝试使用SpeechSynthesizer在c#上创建.wav文件时。

Exception on IIS Server When try to create .wav file on c# using SpeechSynthesizer.

推荐答案

此错误是由于应用程序无法访问SpeechSynthesizer使用的语音。第一个可能的原因是系统上没有任何安装的声音。赔率是不是问题,但你应该通过运行类似下面的代码来仔细检查:

This error is caused when the application is unable to access a voice for the SpeechSynthesizer to use. The first possible cause is the lack of any installed voices on the system. Odds are this isn't the problem, but you should still double check by running something like the following bit of code:

SpeechSynthesizer ssTest = new SpeechSynthesizer();
System.Diagnostics.Debug.WriteLine(ssTest.GetInstalledVoices().Count);

假设上面的数字返回高于0的数字,问题可能是你的应用程序的一个更复杂的问题安全设定。

Assuming the above returns a number higher than 0, the problem is likely a more complicated issue with your application's security settings.

SpeechSynthesizer类中的几个方法,包括SetOutputToWaveFile,要求直接调用者完全信任。对于桌面应用程序(可能是SpeechSynthesizer类可能设计的)而言,这可能不是一个大问题,但在Web环境中会产生更严重的安全后果。因此,IIS的默认设置仅使应用程序部分受信任。有很多方法可以改变这种情况,可能是最快的,当然最脏的方式是将应用程序池的身份从默认值切换到具有管理员权限的帐户,如LocalSystem帐户。

Several methods in the SpeechSynthesizer class, including SetOutputToWaveFile, require the immediate caller to be fully trusted. This might not be a huge concern for a desktop application (which the SpeechSynthesizer class was likely designed for) but has more serious security repercussions in a web environment. Therefore, IIS's default settings only make applications partially trusted. There are a number of ways to change this, possibly the quickest and certainly the dirtiest way is switching the application pool's identity from the default to an account with administrator privileges like the LocalSystem account.

再一次,只是为了强调,这将严重损害您的应用程序的安全性,应该在实施之前进行全面研究。

Once again, just for emphasis, this will seriously harm the security of your application and should be fully researched before implementing.

这篇关于系统上未安装语音或当前安全设置无法使用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆