#include <FBaseColIList.h>\r
#include <FBaseColArrayList.h>\r
#include <FBaseString.h>\r
+#include <FSystem.h>\r
#include <FBaseUtilStringTokenizer.h>\r
#include <FLclLocale.h>\r
#include <FUixSpeechSpeechToText.h>\r
using namespace Tizen::Base;\r
using namespace Tizen::Base::Collection;\r
using namespace Tizen::Locales;\r
+using namespace Tizen::System;\r
\r
namespace Tizen { namespace Uix { namespace Speech\r
{\r
result\r
_SpeechToTextImpl::Initialize(void)\r
{\r
- SysAssertf(__isInitialized != true,\r
+ bool isSupported;\r
+ SysAssertf(__isInitialized != true,\r
"Already calling Initialize() twice or more on a same instance is not allowed for this class.");\r
\r
+ Tizen::System::SystemInfo::GetValue("http://tizen.org/feature/speech.recognition", isSupported); \r
+ SysTryReturnResult(NID_UIX_SPEECH, isSupported == true, E_UNSUPPORTED_OPERATION, "The STT is Not supported");\r
+\r
int sttError = stt_set_error_cb(__sttHandle, SttErrorReceiver, __pSpeechToTextListener);\r
SysTryLog(NID_UIX_SPEECH, sttError == STT_ERROR_NONE, "[%s] Failed to set the error callback.", GetEngineErrorMessage(sttError));\r
SysTryReturnResult(NID_UIX_SPEECH, sttError == STT_ERROR_NONE, E_OUT_OF_MEMORY, "The memory is insufficient.");\r
#include <FBaseColIList.h>
#include <FBaseColArrayList.h>
#include <FBaseString.h>
+#include <FSystem.h>
#include <FBaseUtilStringTokenizer.h>
#include <FLclLocale.h>
#include <FUixSpeechTextToSpeech.h>
using namespace Tizen::Base;
using namespace Tizen::Base::Collection;
using namespace Tizen::Locales;
+using namespace Tizen::System;
#ifdef __cplusplus
extern "C"
result
_TextToSpeechImpl::Initialize(void)
{
+ bool isSupported;
SysAssertf(__isInitialized != true,
"Already calling Initialize() twice or more on a same instance is not allowed for this class.");
+ Tizen::System::SystemInfo::GetValue("http://tizen.org/feature/speech.synthesis", isSupported);
+ SysTryReturnResult(NID_UIX_SPEECH, isSupported == true, E_UNSUPPORTED_OPERATION, "The TTS is Not supported");
+
int ttsError = tts_set_error_cb(__ttsHandle, TtsErrorReceiver, (void*)(__pTextToSpeechListener));
SysTryLog(NID_UIX_SPEECH, ttsError == TTS_ERROR_NONE, "[%s] Failed to set the error callback.", GetEngineErrorMessage(ttsError));
SysTryReturnResult(NID_UIX_SPEECH, ttsError == TTS_ERROR_NONE, E_OUT_OF_MEMORY, "The memory is insufficient.");