1

我正在关注教程:

STT:识别语音

我正在使用 STT API,但在 Samsung Gear S2 上调用 create_stt_handle 时收到 STT_ERROR_NOT_SUPPORTED 错误。此设备是否支持此 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;
        }
4

1 回答 1

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

于 2016-02-26T02:21:38.060 回答