2 * Copyright (c) 2011-2015 Samsung Electronics Co., Ltd All Rights Reserved
4 * Licensed under the Apache License, Version 2.0 (the License);
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
8 * http://www.apache.org/licenses/LICENSE-2.0
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an AS IS BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
18 #ifndef __VCD_ENGINE_AGENT_H_
19 #define __VCD_ENGINE_AGENT_H_
22 #include "voice_control_plugin_engine.h"
29 * Constants & Structures
32 #define ENGINE_PATH_SIZE 256
34 typedef void (*result_callback)(vcp_result_event_e event, int* result_id, int count, const char* all_result,
35 const char* non_fixed_result, const char* nlu_result, const char* msg, int* user_info, void *user_data);
37 typedef void (*asr_result_callback)(vcp_asr_result_event_e event, const char* asr_result, void *user_data);
39 typedef void (*nlg_result_callback)(const char* nlg_result, void *user_data);
42 typedef void (*pre_result_callback)(vcp_pre_result_event_e event, const char* pre_result, void *user_data);
44 typedef void (*nlu_result_callback)(vcp_result_event_e event, const char* nlu_result, void *user_data);
47 typedef void (*error_callback)(vcp_error_e error, const char* msg, void *user_data);
49 typedef void (*silence_dectection_callback)(void *user_data);
53 /** Init engine agent */
54 //int vcd_engine_agent_init(pre_result_callback pre_result_cb, result_callback result_cb, nlu_result_callback nlu_result_cb, error_callback error_cb);
55 int vcd_engine_agent_init(asr_result_callback asr_result_cb, result_callback result_cb, nlg_result_callback nlg_result_cb, error_callback error_cb);
57 /** Release engine agent */
58 int vcd_engine_agent_release();
60 bool vcd_engine_is_available_engine();
62 /** Set current engine */
63 int vcd_engine_agent_initialize_current_engine();
65 /** load current engine */
66 int vcd_engine_agent_load_current_engine();
68 /** Unload current engine */
69 int vcd_engine_agent_unload_current_engine();
71 /** test for language list */
72 int vcd_print_enginelist();
75 int vcd_engine_get_audio_format(const char* audio_id, vcp_audio_type_e* types, int* rate, int* channels);
77 int vcd_engine_supported_langs(GList** lang_list);
79 int vcd_engine_get_current_language(char** lang);
81 int vcd_engine_set_current_language(const char* language);
83 int vcd_engine_set_commands();
85 /* normal recognition */
86 int vcd_engine_recognize_start(bool silence);
88 int vcd_engine_recognize_audio(const void* data, unsigned int length, vcp_speech_detect_e* speech_detected);
90 int vcd_engine_recognize_stop();
92 int vcd_engine_recognize_cancel();
94 int vcd_engine_set_audio_type(const char* audio);
96 int vcd_engine_set_domain(int pid, const char* domain);
98 int vcd_engine_get_nlu_base_info(int pid, const char* key, char** value);
100 // int vcd_engine_set_private_data(const char* data);
101 int vcd_engine_set_private_data(int pid, const char* key, const char* data);
103 // int vcd_engine_get_private_data(char** data);
104 int vcd_engine_get_private_data(int pid, const char* key, char** data);
106 int vcd_engine_process_text(int pid, const char* text);
108 int vcd_engine_process_list_event(int pid, const char* event);
110 int vcd_engine_process_haptic_event(int pid, const char* event);
117 #endif /* __VCD_ENGINE_AGENT_H_ */