return 0;
}
+int sttd_engine_agent_get_audio_format(stte_audio_type_e* type, int* rate, int* num_of_channels)
+{
+ RETVM_IF(NULL == type || NULL == rate || NULL == num_of_channels, STTD_ERROR_INVALID_PARAMETER, "[Engine Agent ERROR] Input parameter");
+ int tmp = __sttd_engine_agent_check_precondition();
+ if (STTD_ERROR_NONE != tmp)
+ return tmp;
+
+ int ret = stt_engine_get_audio_format(type, rate, num_of_channels);
+ if (0 != ret) {
+ SLOG(LOG_ERROR, TAG_STTD, "[Engine Agent ERROR] Fail to get to audio format : %d", ret);
+ return ret;
+ }
+
+ return STTD_ERROR_NONE;
+}
+
/*
* STT Engine Interfaces for client
*/
int sttd_engine_agent_is_recognition_type_supported(const char* type, bool* support);
+int sttd_engine_agent_get_audio_format(stte_audio_type_e* type, int* rate, int* num_of_channels);
+
int sttd_engine_agent_set_default_engine(const char* engine_uuid);
int sttd_engine_agent_set_default_language(const char* language);
return STTD_ERROR_NONE;
}
+int sttd_server_get_audio_format(unsigned int uid, stte_audio_type_e *type, int *rate, int *num_of_channels)
+{
+ /* check if uid is valid */
+ app_state_e state = APP_STATE_CREATED;
+ if (0 != sttd_client_get_state(uid, &state)) {
+ SLOG(LOG_ERROR, TAG_STTD, "[Server ERROR] uid is NOT valid ");
+ return STTD_ERROR_INVALID_PARAMETER;
+ }
+
+ if (NULL == type || NULL == rate || NULL == num_of_channels) {
+ SLOG(LOG_ERROR, TAG_STTD, "[Server ERROR] Input parameter is NULL");
+ return STTD_ERROR_INVALID_PARAMETER;
+ }
+
+ int ret = sttd_engine_agent_get_audio_format(type, rate, num_of_channels);
+ if (0 != ret) {
+ SLOG(LOG_ERROR, TAG_STTD, "[Server ERROR] Fail to get recognition type supported : result(%d)", ret);
+ return ret;
+ }
+
+ SLOG(LOG_INFO, TAG_STTD, "[Server SUCCESS] Audio format: type(%d), rate(%d), number of channels(%d)", *type, *rate, *num_of_channels);
+ return STTD_ERROR_NONE;
+}
+
int sttd_server_set_start_sound(unsigned int uid, const char* file)
{
/* check if uid is valid */
int sttd_server_is_recognition_type_supported(unsigned int uid, const char* type, int* support);
+int sttd_server_get_audio_format(unsigned int uid, stte_audio_type_e *type, int *rate, int *num_of_channels);
+
int sttd_server_set_start_sound(unsigned int uid, const char* file);
int sttd_server_set_stop_sound(unsigned int uid, const char* file);