SpVoice和SpeechSynthesizer之间有什么区别 [英] what is the difference between SpVoice and SpeechSynthesizer

查看:115
本文介绍了SpVoice和SpeechSynthesizer之间有什么区别的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

使用语音API或 SAPI ?

using SpeechLib;
SpVoice speech = new SpVoice();
speech.Speak(text, SpeechVoiceSpeakFlags.SVSFlagsAsync);

返回 Apacela声音

SpeechSynthesizer ss = new SpeechSynthesizer();
ss.SpeakAsync ("Hello, world");

不适用于 Apacela语音.

第一个返回所有声音,但是第二个仅返回很少声音.这与SAPI 5.1和SAPI 5.3有关吗?

The first one return all voices but the second one only return few voices. Is this something related to SAPI 5.1 and SAPI 5.3?

在Vista和XP上的行为相同,在两个SpVoice上都可以检测到Apacela语音,但是使用SpeechSynthesizer,在XP和Vista上都没有检测到语音.

The behavior is same on Vista and XP, on both SpVoice was able to detect the Apacela voice but using SpeechSynthesizer, the voices does not detected on both XP and Vista.

我想XP使用SAPI 5.1,而Vista使用SAPI 5.3,那么为什么在所有操作系统上都具有相同的行为,而API却具有不同的行为?

I guess XP uses SAPI 5.1, and Vista uses SAPI 5.3 then why the same behavior on all OS, but different behavior with the API?

还有哪个API更强大,两种方法/API有何区别?

Also which API is more powerful and what are the difference between the two ways/API?

推荐答案

SpeechLib是一个Interop DLL,它在幕后使用了经典的基于COM的SAPI.System.Speech是Microsoft开发的,可直接从托管代码中与文本到语音(和语音识别)进行交互.

SpeechLib is an Interop DLL that makes use of classic COM-based SAPI under the covers. System.Speech was developed by Microsoft to interact with Text-to-speech (and voice recognition) directly from within managed code.

通常,在编写托管应用程序时,坚持使用托管库(System.Speech)更为简洁.

In general, it's cleaner to stick with the managed library (System.Speech) when you're writing a managed application.

这绝对与SAPI版本无关-这里最可能的问题是语音供应商(在本例中为Acapela)必须明确实现对某些System.Speech功能的支持.Acapela的声音可能支持您所需要的一切,但也有可能不支持.最好的选择是直接询问Acapela集团.

It's definitely not related to SAPI version--the most likely problem here is that a voice vendor (in this case Acapela) has to explicitly implement support for certain System.Speech features. It's possible that the Acapela voices that you have support everything that is required, but it's also possible that they don't. Your best bet would be to ask the Acapela Group directly.

语音已在HKLM \ SOFTWARE \ Microsoft \ Speech \ Tokens中注册,您应该会在其中看到Windows内置语音以及已添加的Acapela语音.如果您发现它们的注册方式有任何明显的不同,您可以 使他们的注册与MS-Anna的注册相匹配,从而使Acapela声音起作用.

Voices are registered in HKLM\SOFTWARE\Microsoft\Speech\Tokens, and you should see the Windows built-in voices, as well as the Acapela voices that you have added listed there. If you spot any obvious differences in how they're registered, you might be able to make the Acapela voices work by making their registration match that of, for example, MS-Anna.

但是我要说最有可能的可能性是,尚未更新Acapela语音以支持System.Speech所需的所有接口.

But I'd say the most likely possibility is that the Acapela voices have not been updated to support all of the interfaces required by System.Speech.

这篇关于SpVoice和SpeechSynthesizer之间有什么区别的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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