updated with E_UNSUPPORTED_OPERATION error value
authorsanthosh.au <santhosh.au@samsung.com>
Tue, 16 Apr 2013 08:06:55 +0000 (13:36 +0530)
committersanthosh.au <santhosh.au@samsung.com>
Tue, 16 Apr 2013 08:13:09 +0000 (13:43 +0530)
Change-Id: I283de3401fe363b23b1e3eb73a4d198df2cc92d4
Signed-off-by: santhosh.au <santhosh.au@samsung.com>
src/stt/FUixSpeech_SpeechToTextImpl.cpp
src/tts/FUixSpeech_TextToSpeechImpl.cpp

index 11cb404c734199a34441091728b3337f7b225bed..ad1a958a95f5d509772ec3358dadbb7119bb6e3d 100644 (file)
@@ -26,6 +26,7 @@
 #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
@@ -36,6 +37,7 @@
 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
@@ -265,9 +267,13 @@ _SpeechToTextImpl::Construct(ISpeechToTextEventListener& listener)
 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
index c87acde6fafd21a934e12e840b7b3a206a08ab2b..684a11209d531a826d5c6eb62f68a377393b7b1c 100644 (file)
@@ -26,6 +26,7 @@
 #include <FBaseColIList.h>
 #include <FBaseColArrayList.h>
 #include <FBaseString.h>
+#include <FSystem.h>
 #include <FBaseUtilStringTokenizer.h>
 #include <FLclLocale.h>
 #include <FUixSpeechTextToSpeech.h>
@@ -36,6 +37,7 @@
 using namespace Tizen::Base;
 using namespace Tizen::Base::Collection;
 using namespace Tizen::Locales;
+using namespace Tizen::System;
 
 #ifdef __cplusplus
 extern "C"
@@ -287,9 +289,13 @@ _TextToSpeechImpl::Construct(ITextToSpeechEventListener& listener)
 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.");