文字转语音问题 [英] Text to Speech problem

查看:145
本文介绍了文字转语音问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在使用本教程中的代码时,我的程序无法正常工作 http://www.codeproject.com/KB/dotnet/Speech_Sample.aspx#_comments [ ^ ]

我已经按照本教程进行了讲解,并仅使用该代码创建了一个项目,该项目可以正常工作.然后将其放入我的项目时,出现此错误:

I am having some problems getting my program to work while using the code from this tutorial http://www.codeproject.com/KB/dotnet/Speech_Sample.aspx#_comments[^]

I have followed the tutorial and made a project with only that code, which works. Its when I then put it into my project I get this error:

error C3083: ''Speech'': the symbol to the left of a ''::'' must be a type<br />
error C2039: ''Synthesis'' : is not a member of ''System''<br />
error C2871: ''Synthesis'' : a namespace with this name does not exist



错误来自我在顶部添加的行:

using namespace System::Speech::Synthesis;

由于未定义内容等原因,这会造成更多错误.

我已经搜索了这些错误,但是没有找到任何类似或我理解的解决方案.我刚刚开始使用Visual C ++.

任何帮助将不胜感激!谢谢.



The errors are coming from the line that I added in at the top:

using namespace System::Speech::Synthesis;

This then create more errors due to things not being defined etc..

I''ve googled these errors and have not found any solutions that are similar or that I understand. I have just started using Visual C++.

Any help would be greatly appreciated! Thank you.

推荐答案

那不是真正的C ++示例.您需要.NET框架.
但是,如果您对语音编程感兴趣,则应下载语音SDK(SAPI5).这也包含很多示例.抱歉,我不能给你链接(使用互联网搜索).
问候.
That isnt really C++ example. You need the .NET framework.
But if you are interested in speech programming, you should download the speech SDK (SAPI5). This contains a lot of examples too. Sorry i cant give you a link (use internet search).
Regards.


很可能,您未能将对程序集System.Speech的引用添加到项目中.此外,项目应具有"/clr"选项.

我应该说,在没有相关代码的情况下发布一些错误不是很好.您是否要强制CodeProject成员进行猜测.另外,我必须将您的标签从C ++更改为C ++/CLI.您应该了解:即使您可以在同一项目中使用它们,它们也是不同的语言.

请下一次彻底提出问题.

—SA
Most likely, you failed to add the reference to the assembly System.Speech to the project. Also, the project should have "/clr" option.

I should say it''s not very nice to post some errors without relevant code. Do you want to force CodeProject members into guesswork. Also, I have to change your tag from C++ to C++/CLI. You should understand: those are different languages, even though you can uses them in the same project.

Please next time formulate the Question thoroughly.

—SA


这篇关于文字转语音问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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