www.pudn.com > HMRspeech.rar > TextToSpeech.h, change:2009-11-02,size:1368b


// TextToSpeech.h: interface for the TextToSpeech class. 
// 
////////////////////////////////////////////////////////////////////// 
 
#if !defined(AFX_TEXTTOSPEECH_H__E7CEE439_83AD_4763_853D_622EF1787BCC__INCLUDED_) 
#define AFX_TEXTTOSPEECH_H__E7CEE439_83AD_4763_853D_622EF1787BCC__INCLUDED_ 
 
#if _MSC_VER > 1000 
#pragma once 
#endif // _MSC_VER > 1000 
 
#include <atlbase.h> 
extern CComModule _Module; 
#include <atlcom.h> 
#include "sapi.h" 
#include <sphelper.h> 
 
// speech message 
#define WM_TTSEVENT WM_USER+101 
 
class CTextToSpeech   
{ 
public: 
	CTextToSpeech(); 
	virtual ~CTextToSpeech(); 
 
	// initialize 
	BOOL Initialize(HWND hWnd = NULL); 
	void Destroy(); 
	// speak 
	HRESULT Speak(const WCHAR *pwcs, DWORD dwFlags = SPF_DEFAULT); 
	HRESULT Pause(); 
	HRESULT Resume(); 
	// rate 
	HRESULT SetRate(long lRateAdjust); 
	HRESULT GetRate(long* plRateAdjust); 
	// volume 
	HRESULT SetVolume(USHORT usVolume); 
	HRESULT GetVolume(USHORT* pusVolume); 
	// voice 
	ULONG GetVoiceCount(); 
	HRESULT GetVoice(WCHAR **ppszDescription, ULONG lIndex = -1); 
	HRESULT SetVoice(WCHAR **ppszDescription); 
	// error string 
	CString GetErrorString() 
	{ 
		return m_sError; 
	} 
	// interface 
	CComPtr<ISpVoice> m_IpVoice; 
 
private: 
	CString m_sError; 
}; 
 
#endif // !defined(AFX_TEXTTOSPEECH_H__E7CEE439_83AD_4763_853D_622EF1787BCC__INCLUDED_)