2016-02-25 2 views
1

я после урока:Samsung Gear S2 TTS Native API

STT: Recognizing Speech

Я использую STT API, но я получаю ошибку STT_ERROR_NOT_SUPPORTED когда я вызов create_stt_handle на Samsung Gear S2. ли этот 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