Exemplo n.º 1
0
bool IsSpeechEngineAvailable()
{
#ifdef HAVE_SAPI_H
	if (s_bTTSDisabled)
		return false;

	static bool _bIsAvailable = false;
	static bool _bCheckedAvailable = false;
	if (!_bCheckedAvailable)
	{
		_bCheckedAvailable = true;
		if (theTextToSpeech.IsActive())
		{
			_bIsAvailable = true;
		}
		else
		{
			_bIsAvailable = theTextToSpeech.CreateTTS();
			theTextToSpeech.ReleaseTTS();
		}
	}
	return _bIsAvailable;
#else//HAVE_SAPI_H
	return false;
#endif//HAVE_SAPI_H
}
Exemplo n.º 2
0
bool Speak(LPCTSTR pszSay)
{
#ifdef HAVE_SAPI_H
	if (theApp.emuledlg == NULL || !theApp.emuledlg->IsRunning())
		return false;
	if (s_bTTSDisabled)
		return false;

	if (!s_bInitialized)
	{
		s_bInitialized = true;
		if (!theTextToSpeech.CreateTTS())
			return false;
	}
	return theTextToSpeech.Speak(pszSay);
#else
	return false;
#endif
}
Exemplo n.º 3
0
bool Speak(LPCTSTR pszSay)
{
#ifdef HAVE_SAPI_H
	if (!theApp.IsRunning())
		return false;
	if (s_bTTSDisabled)
		return false;

	if (!s_bInitialized)
	{
		s_bInitialized = true;
		if (!theTextToSpeech.CreateTTS())
			return false;
	}
	return theTextToSpeech.Speak(pszSay);
#else//HAVE_SAPI_H
	UNREFERENCED_PARAMETER(pszSay);
	return false;
#endif//HAVE_SAPI_H
}