我正在学习本教程:
我正在使用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;
}
STT需要两个功能tizen.org/feature/speech.recognition和tizen.org/feature/microphone
您需要按以下方式检查systemapi支持的功能。
#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论坛中的相同问题。
本文收集自互联网,转载请注明来源。
如有侵权,请联系 [email protected] 删除。
我来说两句