码迷,mamicode.com
首页 > 其他好文 > 详细

TTS

时间:2015-09-08 12:08:38      阅读:173      评论:0      收藏:0      [点我收藏+]

标签:

#include <sapi.h>

#pragma comment(lib,"ole32.lib")
#pragma comment(lib,"sapi.lib")

int main(int argc, char* argv[])
{
	ISpVoice * pVoice = NULL;

	if (FAILED(::CoInitialize(NULL)))
		return FALSE;

	HRESULT hr = CoCreateInstance(CLSID_SpVoice, NULL, CLSCTX_ALL, IID_ISpVoice, (void **)&pVoice);
	if (SUCCEEDED(hr))
	{
		
		hr = pVoice->Speak(L"您好!请缴费10元", 0, NULL);
		//Sleep(10);
		hr = pVoice->Speak(L"您好!请缴费10元", 0, NULL);
		pVoice->Release();
		pVoice = NULL;
	}
	::CoUninitialize();
	return TRUE;
}

  

TTS

标签:

原文地址:http://www.cnblogs.com/haihai187/p/4790906.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!