2 * Copyright 2018-2019 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 _MULTI_ASSISTANT_SERVICE_H_
19 #define _MULTI_ASSISTANT_SERVICE_H_
21 #include <dlog/dlog.h>
28 #define MAX_APPID_LEN 255
30 int mas_client_initialize(int pid);
32 int mas_client_deinitialize(int pid);
34 int mas_client_get_audio_format(int pid, int* rate, int* channel, int* audio_type);
36 int mas_client_get_audio_source_type(int pid, char** type);
38 int mas_client_request_speech_data(int pid);
40 int mas_client_send_asr_result(int pid, int event, char* asr_result);
42 int mas_client_send_result(int pid, char* display_text, char* utterance_text, char* result_json);
44 int mas_client_send_recognition_result(int pid, int result);
46 int mas_client_start_streaming_audio_data(int pid, int type);
48 int mas_client_stop_streaming_audio_data(int pid, int type);
50 int mas_client_update_voice_feedback_state(int pid, int state);
52 int mas_client_send_assistant_specific_command(int pid, const char *command);
54 int mas_client_set_background_volume(int pid, double ratio);
56 int mas_client_set_preprocessing_allow_mode(int pid, int mode, const char* appid);
58 int mas_client_send_preprocessing_result(int pid, bool result);
60 int mas_ui_client_initialize(int pid);
62 int mas_ui_client_deinitialize(int pid);
64 int mas_ui_client_change_assistant(const char* appid);
66 int mas_get_current_client_pid();
68 int mas_get_current_preprocessing_client_pid();
70 int mas_get_client_pid_by_wakeup_word(const char *wakeup_word);
72 int mas_get_client_pid_by_appid(const char *appid);
74 bool mas_get_client_custom_ui_option_by_appid(const char *appid);
76 const char* mas_get_client_appid_by_wakeup_word(const char *wakeup_word);
78 int mas_set_current_client_by_wakeup_word(const char *wakeup_word);
80 int mas_set_current_client_by_appid(const char *appid);
82 int mas_launch_client_by_wakeup_word(const char *wakeup_word);
84 int mas_prelaunch_default_assistant();
87 CLIENT_LAUNCH_MODE_ACTIVATION,
88 CLIENT_LAUNCH_MODE_PRELAUNCH,
90 int mas_launch_client_by_appid(const char *appid, CLIENT_LAUNCH_MODE launch_mode);
93 PREPROCESSING_STATE_NONE,
94 PREPROCESSING_STATE_WAKEUP_PREPROCESS_ENABLED,
95 PREPROCESSING_STATE_WAKEUP_PREPROCESS_DISABLED,
96 PREPROCESSING_STATE_PREPROCESSING_UTTERANCE,
97 PREPROCESSING_STATE_PREPROCESSING_FOLLOW_UP,
98 } PREPROCESSING_STATE;
101 PREPROCESSING_STATE_EVENT_ASSISTANT_ACTIVATED,
102 PREPROCESSING_STATE_EVENT_PREPROCESSING_ALLOW_MODE_CHANGED,
103 PREPROCESSING_STATE_EVENT_UTTERANCE_STREAMING_STARTED,
104 PREPROCESSING_STATE_EVENT_FOLLOW_UP_STREAMING_STARTED,
105 PREPROCESSING_STATE_EVENT_PREPROCESSING_SUCCEEDED,
106 PREPROCESSING_STATE_EVENT_PREPROCESSING_FAILED,
107 } PREPROCESSING_STATE_EVENT;
109 int mas_process_preprocessing_state_event(PREPROCESSING_STATE_EVENT event);
116 #endif /* _MULTI_ASSISTANT_SERVICE_H_ */