2 * Copyright 2018 Samsung Electronics Co., Ltd
4 * Licensed under the Flora License, Version 1.1 (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://floralicense.org/license/
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 _WAKEUP_MANAGER_WRAPPER_H_
19 #define _WAKEUP_MANAGER_WRAPPER_H_
24 #include <tzplatform_config.h>
25 #include <multi_assistant.h>
27 #include "wakeup_interfaces.h"
34 WAKEUP_SPEECH_STATUS_NONE = -1, /**< None */
35 WAKEUP_SPEECH_STATUS_BEGINNING_POINT_DETECTED = 1, /**< Beginning point of speech is detected */
36 WAKEUP_SPEECH_STATUS_END_POINT_DETECTED = 2 /**< End point of speech is detected */
37 } wakeup_service_speech_status_e;
40 WAKEUP_MANAGER_STATE_INACTIVE = 0,
41 WAKEUP_MANAGER_STATE_LISTENING = 1,
42 WAKEUP_MANAGER_STATE_UTTERANCE = 2,
43 WAKEUP_MANAGER_STATE_PROCESSING = 3,
44 WAKEUP_MANAGER_STATE_VOICE_FEEDBACK = 4
45 } wakeup_manager_state_e;
47 typedef void (*wakeup_service_wakeup_event_cb)(wakeup_event_info wakeup_info, void* user_data);
49 typedef void (*wakeup_service_speech_streaming_cb)(wakeup_speech_streaming_event_e event, void* buffer, int len, void *user_data);
51 typedef void (*wakeup_service_speech_status_cb)(wakeup_service_speech_status_e status, void *user_data);
53 typedef void (*wakeup_service_error_cb)(int error, const char* err_msg, void* user_data);
55 typedef void (*wakeup_service_audio_data_require_status_cb)(bool require, void* user_data);
57 typedef void (*wakeup_service_streaming_section_changed_cb)(ma_audio_streaming_data_section_e section, void* user_data);
60 MA_PLUGIN_EVENT_VOICE_KEY_PRESSED = 0,
61 MA_PLUGIN_EVENT_VOICE_KEY_RELEASED,
62 MA_PLUGIN_EVENT_VOICE_KEY_RELEASED_AFTER_PUSH = MA_PLUGIN_EVENT_VOICE_KEY_RELEASED,
63 MA_PLUGIN_EVENT_VOICE_KEY_RELEASED_AFTER_TAP,
67 MA_SYSTEM_VOLUME_EVENT_CHANGE,
68 MA_SYSTEM_VOLUME_EVENT_RECOVER
69 } ma_system_volume_event_e;
73 bool ui_panel_enabled;
76 EXPORT_API int wakeup_manager_initialize(void);
78 EXPORT_API int wakeup_manager_deinitialize(void);
80 EXPORT_API int wakeup_manager_get_settings(ma_plugin_settings **settings, size_t *struct_size);
82 EXPORT_API int wakeup_manager_add_assistant_wakeup_word(const char* appid, const char* wakeup_word, const char* language);
84 EXPORT_API int wakeup_manager_add_assistant_language(const char* appid, const char* language);
86 EXPORT_API int wakeup_manager_set_assistant_wakeup_engine(const char* appid, const char *engine);
88 EXPORT_API int wakeup_manager_set_language(const char* language);
90 EXPORT_API int wakeup_manager_activate(void);
92 EXPORT_API int wakeup_manager_deactivate(void);
94 EXPORT_API int wakeup_manager_update_voice_feedback_state(const char *appid, int state);
96 EXPORT_API int wakeup_manager_send_assistant_specific_command(const char* appid, const char* command);
98 EXPORT_API int wakeup_manager_set_background_volume(const char *appid, double ratio);
100 EXPORT_API int wakeup_manager_update_recognition_result(const char *appid, int result);
102 EXPORT_API int wakeup_manager_process_event(int event, void* data, int len);
104 EXPORT_API int wakeup_manager_start_streaming_utterance_data(void);
106 EXPORT_API int wakeup_manager_stop_streaming_utterance_data(void);
108 EXPORT_API int wakeup_manager_start_streaming_previous_utterance_data(void);
110 EXPORT_API int wakeup_manager_stop_streaming_previous_utterance_data(void);
112 EXPORT_API int wakeup_manager_start_streaming_follow_up_data(void);
114 EXPORT_API int wakeup_manager_stop_streaming_follow_up_data(void);
116 EXPORT_API int wakeup_manager_get_audio_format(int *rate, int *channel, int *audio_type);
118 EXPORT_API int wakeup_manager_get_audio_source_type(char** type);
120 EXPORT_API int wakeup_manager_set_wake_word_audio_require_flag(bool require);
122 EXPORT_API int wakeup_manager_set_wakeup_event_callback(wakeup_service_wakeup_event_cb callback, void* user_data);
124 EXPORT_API int wakeup_manager_set_utterance_streaming_callback(wakeup_service_speech_streaming_cb callback, void* user_data);
126 EXPORT_API int wakeup_manager_set_previous_utterance_streaming_callback(wakeup_service_speech_streaming_cb callback, void* user_data);
128 EXPORT_API int wakeup_manager_set_follow_up_streaming_callback(wakeup_service_speech_streaming_cb callback, void* user_data);
130 EXPORT_API int wakeup_manager_set_speech_status_callback(wakeup_service_speech_status_cb callback, void* user_data);
132 EXPORT_API int wakeup_manager_set_error_callback(wakeup_service_error_cb callback, void* user_data);
134 EXPORT_API int wakeup_manager_set_streaming_section_changed_callback(wakeup_service_streaming_section_changed_cb callback, void* user_data);
136 /* Internal API declarations for dependency modules */
138 int wakeup_manager_feed_audio_data(wakeup_speech_streaming_event_e event, void* buffer, int len);
144 #endif /* _WAKEUP_MANAGER_WRAPPER_H_ */