三星Gear S2 TTS Native API

时间:2016-02-25 14:44:52

标签: service voice-recognition tizen samsung-gear-s2

我按照教程:

STT: Recognizing Speech

我使用的是STT API,但是当我收到STT_ERROR_NOT_SUPPORTED错误时 在Samsung Gear 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 个答案:

答案 0 :(得分:1)

需要两个功能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