2016-02-25 74 views
1

我下面的教程:三星齒輪S2 TTS的Native API

STT: Recognizing Speech

我使用STT API,但我收到STT_ERROR_NOT_SUPPORTED錯誤時,三星齒輪S2我 呼叫create_stt_handle。 這是API支持此設備,或有一些錯誤調用服務service_app_control此功能:

create_stt_handle() { 
        int ret; 
        ret = stt_create(&stt); 
        if (STT_ERROR_NONE != ret) 
        { 
         dlog_print(DLOG_DEBUG, LOG_TAG, "create_stt_handle %#010x", ret); 
        } 
        if (STT_ERROR_NOT_SUPPORTED == ret) 
        { 
         dlog_print(DLOG_DEBUG, LOG_TAG, "create_stt_handle STT_ERROR_NOT_SUPPORTED"); 
        } 

     } 


     void service_app_control(app_control_h app_control, void *data) { 
      // Todo: add your code here. 

      //create_stt_handle(); 

      //set_recognition_result_cb(stt); 

      int error = register_accelerometer_callback(data); 
      //dlog_print(DLOG_DEBUG, LOG_TAG, "after create %d", error); 

      return; 
     } 

回答

1

STT需要兩個特徵tizen.org/feature/speech.recognition和tizen.org/feature/microphone

您需要通過systemapi檢查支持的功能,如下所示。

https://developer.tizen.org/development/api-references/api-reference-2.3.1?redirect=https%3A//developer.tizen.org/dev-guide/2.3.1/org.tizen.native.wearable.apireference/group__CAPI__SYSTEM__SYSTEM__INFO__MODULE.html

#include "system_info.h" 

bool stt_supported = false; 
bool mic_supported = false; 

system_info_get_platform_bool("http://tizen.org/feature/speech.recognition", &stt_supported); 
system_info_get_platform_bool("http://tizen.org/feature/microphone", &mic_supported); 

dlog_print(DLOG_ERROR, LOG_TAG, "supported = %d, %d", stt_supported ,mic_supported); 

也許它不能支持stt_supported。 這是tizen論壇中的同一個問題。

https://developer.tizen.org/forums/native-application-development/stt-support-on-real-gear-s2-not-emulator?tab=active