2

我需要开发一个简单的 64 位 C++ 文本转语音 (TTS) 程序以在 Windows 7 和 Vista 上运行。我的第一步是尝试从 SAPI 5.4 教程编译程序。但我在我的 Windows 7 机器上找不到所需的 SAPI 5.4 包。我在 Internet 上搜索,只有 SAPI 5.1 可用于 Windows XP。
微软语音技术页面声称“用于对 Windows 7 中包含的语音引擎进行编程的本机代码 API”。SAPI 5.4 教程有以下说明 :

Step 1. Setting up the Project:  
…  
Code Listing 1  
Next add the paths to SAPI.h and SAPI.lib files. The paths shown are for a 
standard SAPI SDK install. If the compiler is unable to locate either file, 
or if a nonstandard install was performed, use the new path to the files. 
Change the project settings to reflect the paths. Using the Project->Settings. 
menu item, set the SAPI.h path. Click the C/C++ tab and select Preprocessor 
from the Category drop-down list. Enter the following in the "Additional 
include directories": C:\Program Files\Microsoft Speech SDK 5.4\Include.  


To set the SAPI.lib path:    
1.  Select the Link tab from the Same Settings dialog box.  
2.  Choose Input from the Category drop-down list.  
3.  Add the following path to the "Additional library path": 
    C:\Program Files\Microsoft Speech SDK 5.4\Lib\i386.  
4.  Also add "sapi.lib" to the "Object/library modules" line. Be sure that the 
    name is separated by a space.   
…  

上述说明中的 2 个文件夹在我的 Windows 7 PC 上不存在。我为 Windows 7 和 .NET Framework 4 安装了 Windows SDK,但这两个文件夹仍然不存在。
我应该怎么做才能在我的 Windows 7 机器上安装 SAPI 5.4 并编译上述教程中的程序?
非常感谢您的帮助!
大卫

4

1 回答 1

5

Microsoft Speech SDK 5.4 或 SAPI 5.4 包含在“Windows SDK for Windows 7 and .NET Frameword 4”包中。它可以从微软下载中心下载。安装包后,包含文件在“c:\Program Files\Microsoft SDKs\Windows\v7.1\include”,库文件在“c:\Program Files\Microsoft SDKs\Windows\v7.1\库\x64"。编译程序时无需指定这两个位置。Microsoft 的 SAPI 5.4 教程和一些相关文档已经过时。

于 2013-10-01T13:58:06.407 回答