2 * Copyright (c) 2011-2016 Samsung Electronics Co., Ltd All Rights Reserved
3 * Licensed under the Apache License, Version 2.0 (the "License");
4 * you may not use this file except in compliance with the License.
5 * You may obtain a copy of the License at
6 * http://www.apache.org/licenses/LICENSE-2.0
7 * Unless required by applicable law or agreed to in writing, software
8 * distributed under the License is distributed on an "AS IS" BASIS,
9 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
10 * See the License for the specific language governing permissions and
11 * limitations under the License.
16 #ifndef __STTD_ENGINE_AGENT_H_
17 #define __STTD_ENGINE_AGENT_H_
19 #include "sttd_main.h"
27 * Constants & Structures
30 #define ENGINE_PATH_SIZE 256
32 typedef void (*result_callback)(sttp_result_event_e event, const char* type,
33 const char** data, int data_count, const char* msg, void *user_data);
35 typedef bool (*result_time_callback)(int index, sttp_result_time_event_e event, const char* text,
36 long start_time, long end_time, void *user_data);
38 typedef void (*silence_dectection_callback)(sttp_silence_type_e type, void *user_data);
43 * STT Engine Agent Interfaces
46 /** Init / Release engine agent */
47 int sttd_engine_agent_init(result_callback result_cb, result_time_callback time_cb,
48 silence_dectection_callback silence_cb);
50 int sttd_engine_agent_release();
54 int sttd_engine_agent_initialize_engine_list();
57 /** load / unload engine */
58 int sttd_engine_agent_load_current_engine(int uid, const char* engine_uuid);
60 int sttd_engine_agent_unload_current_engine(int uid);
62 bool sttd_engine_agent_is_default_engine();
64 int sttd_engine_agent_get_engine_list(GSList** engine_list);
66 int sttd_engine_agent_get_current_engine(int uid, char** engine_uuid);
69 /** Get/Set app option */
70 bool sttd_engine_agent_need_network(int uid);
72 int sttd_engine_agent_supported_langs(int uid, GSList** lang_list);
74 int sttd_engine_agent_get_default_lang(int uid, char** lang);
76 int sttd_engine_agent_set_private_data(int uid, const char* key, const char* data);
78 int sttd_engine_agent_get_private_data(int uid, const char* key, char** data);
80 int sttd_engine_agent_get_option_supported(int uid, bool* silence);
82 int sttd_engine_agent_is_credential_needed(int uid, bool* credential);
84 int sttd_engine_agent_is_recognition_type_supported(int uid, const char* type, bool* support);
86 int sttd_engine_agent_set_default_engine(const char* engine_uuid);
88 int sttd_engine_agent_set_default_language(const char* language);
90 int sttd_engine_agent_set_silence_detection(bool value);
92 int sttd_engine_agent_check_app_agreed(int uid, const char* appid, bool* result);
95 int sttd_engine_agent_recognize_start_engine(int uid, const char* lang, const char* recognition_type,
96 int silence, const char* credential, void* user_param);
98 int sttd_engine_agent_recognize_start_recorder(int uid);
100 int sttd_engine_agent_set_recording_data(int uid, const void* data, unsigned int length);
102 int sttd_engine_agent_recognize_stop(int uid);
104 int sttd_engine_agent_recognize_stop_recorder(int uid);
106 int sttd_engine_agent_recognize_stop_engine(int uid);
108 int sttd_engine_agent_recognize_cancel(int uid);
115 #endif /* __STTD_ENGINE_AGENT_H_ */