#define MA_METHOD_STOP_STREAMING_AUDIO_DATA "ma_method_stop_streaming_audio_data"
#define MA_METHOD_UPDATE_VOICE_FEEDBACK_STATE "ma_method_update_voice_feedback_state"
#define MA_METHOD_SEND_ASSISTANT_SPECIFIC_COMMAND "ma_method_send_assistant_specific_command"
-#define MA_METHOD_CHANGE_SYSTEM_VOLUME "ma_method_change_system_volume"
+#define MA_METHOD_SET_BACKGROUND_VOLUME "ma_method_set_background_volume"
#define MA_METHOD_ERROR "ma_method_error"
#define MA_UI_METHOD_INITIALIZE "ma_ui_method_initialize"
int mas_client_send_assistant_specific_command(int pid, const char *command);
+int mas_client_set_background_volume(int pid, double ratio);
+
int mas_client_update_recognition_result(int pid, int result);
int mas_ui_client_initialize(int pid);
int multi_assistant_service_plugin_send_assistant_specific_command(const char *appid, const char* command);
-int multi_assistant_service_plugin_change_system_volume(const char *appid, int event);
+int multi_assistant_service_plugin_set_background_volume(const char *appid, double ratio);
int multi_assistant_service_plugin_update_recognition_result(const char* appid, int result);
typedef int (*wakeup_manager_update_voice_feedback_state)(const char* appid, int state);
#define MA_WAKEUP_MANAGER_FUNC_SEND_ASSISTANT_SPECIFIC_COMMAND "wakeup_manager_send_assistant_specific_command"
typedef int (*wakeup_manager_send_assistant_specific_command)(const char* appid, const char* command);
-#define MA_WAKEUP_MANAGER_FUNC_CHANGE_SYSTEM_VOLUME "wakeup_manager_change_system_volume"
-typedef int (*wakeup_manager_change_system_volume)(const char* appid, int event);
+#define MA_WAKEUP_MANAGER_FUNC_SET_BACKGROUND_VOLUME "wakeup_manager_set_background_volume"
+typedef int (*wakeup_manager_set_background_volume)(const char* appid, double ratio);
#define MA_WAKEUP_MANAGER_FUNC_UPDATE_RECOGNITION_RESULT "wakeup_manager_update_recognition_result"
typedef int (*wakeup_manager_update_recognition_result)(const char* appid, int result);
#define MA_WAKEUP_MANAGER_FUNC_PROCESS_EVENT "wakeup_manager_process_event"
wakeup_manager_deactivate deactivate;
wakeup_manager_update_voice_feedback_state update_voice_feedback_state;
wakeup_manager_send_assistant_specific_command send_assistant_specific_command;
- wakeup_manager_change_system_volume change_system_volume;
+ wakeup_manager_set_background_volume set_background_volume;
wakeup_manager_update_recognition_result update_recognition_result;
wakeup_manager_process_event process_event;
wakeup_manager_start_streaming_utterance_data start_streaming_utterance_data;
EXPORT_API int mas_dependency_start_recording(void);
EXPORT_API int mas_dependency_stop_recording(void);
EXPORT_API int mas_dependency_set_recording_session(unsigned int session);
-EXPORT_API int mas_dependency_change_system_volume(void);
-EXPORT_API int mas_dependency_recover_system_volume(void);
+EXPORT_API int mas_dependency_set_background_volume(double ratio);
EXPORT_API int mas_dependency_get_audio_format(int* rate, int* channel, int* audio_type);
EXPORT_API int mas_dependency_get_audio_source_type(char** type);
void dependency_default_audio_voice_key_pressed_set(bool pressed);
-void dependency_default_audio_change_system_volume();
-void dependency_default_audio_recover_system_volume();
+void dependency_default_audio_set_background_volume(double ratio);
void dependency_default_audio_get_audio_format(int* rate, int* channel, int* audio_type);
void dependency_default_audio_get_audio_source_type(char** type);
return 0;
}
-int mas_dependency_change_system_volume(void)
+int mas_dependency_set_background_volume(double ratio)
{
- dependency_default_audio_change_system_volume();
- return 0;
-}
-
-int mas_dependency_recover_system_volume()
-{
- dependency_default_audio_recover_system_volume();
+ dependency_default_audio_set_background_volume(ratio);
return 0;
}
g_voice_key_pressed = pressed;
}
-void dependency_default_audio_change_system_volume()
+void dependency_default_audio_set_background_volume(double ratio)
{
int ret;
- if (!g_volume_stream) {
- ret = sound_manager_create_stream_information_internal(SOUND_STREAM_TYPE_VOICE_RECOGNITION_SERVICE, NULL, NULL, &g_volume_stream);
- if (0 != ret) {
- LOGD("[Audio] Fail to create stream information, ret(%d)", ret);
- return;
+ if (ratio >= 0.5) {
+ if (g_virtual_sound_stream) {
+ ret = sound_manager_stop_virtual_stream(g_virtual_sound_stream);
+ if (0 != ret) {
+ LOGD("[Audio ERROR] Fail to stop virtual stream, ret(%d)", ret);
+ }
+ ret = sound_manager_destroy_virtual_stream(g_virtual_sound_stream);
+ if (0 != ret) {
+ LOGD("[Audio ERROR] Fail to destroy virtual stream, ret(%d)", ret);
+ return;
+ }
+ g_virtual_sound_stream = NULL;
}
- }
- if (!g_virtual_sound_stream) {
- ret = sound_manager_create_virtual_stream(g_volume_stream, &g_virtual_sound_stream);
- if (0 != ret) {
- if (g_volume_stream) {
- sound_manager_destroy_stream_information(g_volume_stream);
- g_volume_stream = NULL;
+ if (g_volume_stream) {
+ ret = sound_manager_destroy_stream_information(g_volume_stream);
+ if (0 != ret) {
+ LOGD("[Audio ERROR] Fail to destroy stream information, ret(%d)", ret);
+ return;
}
- LOGD("[Audio ERROR] Fail to create virtual stream, ret(%d)", ret);
- return;
+ g_volume_stream = NULL;
}
- }
- if (g_virtual_sound_stream) {
- ret = sound_manager_start_virtual_stream(g_virtual_sound_stream);
- if (0 != ret) {
- if (g_virtual_sound_stream) {
- sound_manager_destroy_virtual_stream(g_virtual_sound_stream);
- g_virtual_sound_stream = NULL;
- }
- if (g_volume_stream) {
- sound_manager_destroy_stream_information(g_volume_stream);
- g_volume_stream = NULL;
+ } else {
+ if (!g_volume_stream) {
+ ret = sound_manager_create_stream_information_internal(SOUND_STREAM_TYPE_VOICE_RECOGNITION_SERVICE, NULL, NULL, &g_volume_stream);
+ if (0 != ret) {
+ LOGD("[Audio] Fail to create stream information, ret(%d)", ret);
+ return;
}
- LOGD("[Audio ERROR] Fail to start virtual stream, ret(%d)", ret);
- return;
}
- }
-}
-void dependency_default_audio_recover_system_volume()
-{
- int ret;
- if (g_virtual_sound_stream) {
- ret = sound_manager_stop_virtual_stream(g_virtual_sound_stream);
- if (0 != ret) {
- LOGD("[Audio ERROR] Fail to stop virtual stream, ret(%d)", ret);
- }
- ret = sound_manager_destroy_virtual_stream(g_virtual_sound_stream);
- if (0 != ret) {
- LOGD("[Audio ERROR] Fail to destroy virtual stream, ret(%d)", ret);
+ if (!g_virtual_sound_stream) {
+ ret = sound_manager_create_virtual_stream(g_volume_stream, &g_virtual_sound_stream);
+ if (0 != ret) {
+ LOGD("[Audio ERROR] Fail to create virtual stream, ret(%d)", ret);
+ return;
+ }
}
- g_virtual_sound_stream = NULL;
- }
-
- if (g_volume_stream) {
- ret = sound_manager_destroy_stream_information(g_volume_stream);
- if (0 != ret) {
- LOGD("[Audio ERROR] Fail to destroy stream information, ret(%d)", ret);
+ if (g_virtual_sound_stream) {
+ ret = sound_manager_start_virtual_stream(g_virtual_sound_stream);
+ if (0 != ret) {
+ LOGD("[Audio ERROR] Fail to start virtual stream, ret(%d)", ret);
+ return;
+ }
}
- g_volume_stream = NULL;
}
}
EXPORT_API int mas_dependency_start_recording(void);
EXPORT_API int mas_dependency_stop_recording(void);
EXPORT_API int mas_dependency_set_recording_session(unsigned int session);
-EXPORT_API int mas_dependency_change_system_volume(void);
-EXPORT_API int mas_dependency_recover_system_volume(void);
+EXPORT_API int mas_dependency_set_background_volume(double ratio);
EXPORT_API int mas_dependency_get_audio_format(int* rate, int* channel, int* audio_type);
EXPORT_API int mas_dependency_get_audio_source_type(char** type);
void dependency_tv_audio_set_recording_session(unsigned int session);
-void dependency_tv_audio_change_system_volume();
-void dependency_tv_audio_recover_system_volume();
+void dependency_tv_audio_set_background_volume(double ratio);
void dependency_tv_audio_voice_key_pressed_set(bool pressed);
return 0;
}
-int mas_dependency_change_system_volume(void)
+int mas_dependency_set_background_volume(double ratio)
{
- dependency_tv_audio_change_system_volume();
- return 0;
-}
-
-int mas_dependency_recover_system_volume()
-{
- dependency_tv_audio_recover_system_volume();
+ dependency_tv_audio_set_background_volume(ratio);
return 0;
}
);
}
-void dependency_tv_audio_change_system_volume()
+void dependency_tv_audio_set_background_volume(double ratio)
{
int ret;
- if (!g_volume_stream) {
- ret = sound_manager_create_stream_information_internal(SOUND_STREAM_TYPE_VOICE_RECOGNITION_SERVICE, NULL, NULL, &g_volume_stream);
- if (0 != ret) {
- LOGE("[Audio] Fail to create stream information, ret(%d)", ret);
- return;
+ if (ratio >= 0.5) {
+ if (g_virtual_sound_stream) {
+ ret = sound_manager_stop_virtual_stream(g_virtual_sound_stream);
+ if (0 != ret) {
+ LOGD("[Audio ERROR] Fail to stop virtual stream, ret(%d)", ret);
+ }
+ ret = sound_manager_destroy_virtual_stream(g_virtual_sound_stream);
+ if (0 != ret) {
+ LOGD("[Audio ERROR] Fail to destroy virtual stream, ret(%d)", ret);
+ return;
+ }
+ g_virtual_sound_stream = NULL;
}
- }
- if (!g_virtual_sound_stream) {
- ret = sound_manager_create_virtual_stream(g_volume_stream, &g_virtual_sound_stream);
- if (0 != ret) {
- if (g_volume_stream) {
- sound_manager_destroy_stream_information(g_volume_stream);
- g_volume_stream = NULL;
+ if (g_volume_stream) {
+ ret = sound_manager_destroy_stream_information(g_volume_stream);
+ if (0 != ret) {
+ LOGD("[Audio ERROR] Fail to destroy stream information, ret(%d)", ret);
+ return;
}
- LOGE("[Audio ERROR] Fail to create virtual stream, ret(%d)", ret);
- return;
+ g_volume_stream = NULL;
}
- }
- if (g_virtual_sound_stream) {
- ret = sound_manager_start_virtual_stream(g_virtual_sound_stream);
- if (0 != ret) {
- if (g_virtual_sound_stream) {
- sound_manager_destroy_virtual_stream(g_virtual_sound_stream);
- g_virtual_sound_stream = NULL;
- }
- if (g_volume_stream) {
- sound_manager_destroy_stream_information(g_volume_stream);
- g_volume_stream = NULL;
+ } else {
+ if (!g_volume_stream) {
+ ret = sound_manager_create_stream_information_internal(SOUND_STREAM_TYPE_VOICE_RECOGNITION_SERVICE, NULL, NULL, &g_volume_stream);
+ if (0 != ret) {
+ LOGD("[Audio] Fail to create stream information, ret(%d)", ret);
+ return;
}
- LOGE("[Audio ERROR] Fail to start virtual stream, ret(%d)", ret);
- return;
}
- }
-}
-void dependency_tv_audio_recover_system_volume()
-{
- int ret;
- if (g_virtual_sound_stream) {
- ret = sound_manager_stop_virtual_stream(g_virtual_sound_stream);
- if (0 != ret) {
- LOGE("[Audio ERROR] Fail to stop virtual stream, ret(%d)", ret);
- }
- ret = sound_manager_destroy_virtual_stream(g_virtual_sound_stream);
- if (0 != ret) {
- LOGE("[Audio ERROR] Fail to destroy virtual stream, ret(%d)", ret);
+ if (!g_virtual_sound_stream) {
+ ret = sound_manager_create_virtual_stream(g_volume_stream, &g_virtual_sound_stream);
+ if (0 != ret) {
+ LOGD("[Audio ERROR] Fail to create virtual stream, ret(%d)", ret);
+ return;
+ }
}
- g_virtual_sound_stream = NULL;
- }
-
- if (g_volume_stream) {
- ret = sound_manager_destroy_stream_information(g_volume_stream);
- if (0 != ret) {
- LOGE("[Audio ERROR] Fail to destroy stream information, ret(%d)", ret);
+ if (g_virtual_sound_stream) {
+ ret = sound_manager_start_virtual_stream(g_virtual_sound_stream);
+ if (0 != ret) {
+ LOGD("[Audio ERROR] Fail to start virtual stream, ret(%d)", ret);
+ return;
+ }
}
- g_volume_stream = NULL;
}
}
if (pressed != g_voice_key_pressed) {
if (pressed) {
set_audio_source_type(VC_AUDIO_ID_BLUETOOTH);
- dependency_tv_audio_change_system_volume();
+ dependency_tv_audio_set_background_volume(0.3);
} else {
- dependency_tv_audio_recover_system_volume();
+ dependency_tv_audio_set_background_volume(1.0);
}
}
int dependency_resolver_start_recording();
int dependency_resolver_stop_recording();
int dependency_resolver_set_recording_session(unsigned int);
-int dependency_resolver_change_system_volume();
-int dependency_resolver_recover_system_volume();
+int dependency_resolver_set_background_volume(double ratio);
int dependency_resolver_get_audio_format(int* rate, int* channel, int* audio_type);
int dependency_resolver_get_audio_source_type(char** type);
typedef int (*mas_dependency_stop_recording)(void);
#define MAS_DEPENDENCY_FUNC_SET_RECORDING_SESSION "mas_dependency_set_recording_session"
typedef int (*mas_dependency_set_recording_session)(unsigned int);
-#define MAS_DEPENDENCY_FUNC_CHANGE_SYSTEM_VOLUME "mas_dependency_change_system_volume"
-typedef int (*mas_dependency_change_system_volume)(void);
-#define MAS_DEPENDENCY_FUNC_RECOVER_SYSTEM_VOLUME "mas_dependency_recover_system_volume"
-typedef int (*mas_dependency_recover_system_volume)(void);
+#define MAS_DEPENDENCY_FUNC_SET_BACKGROUND_VOLUME "mas_dependency_set_background_volume"
+typedef int (*mas_dependency_set_background_volume)(double ratio);
#define MAS_DEPENDENCY_FUNC_GET_AUDIO_FORMAT "mas_dependency_get_audio_format"
typedef int (*mas_dependency_get_audio_format)(int* rate, int* channel, int* audio_type);
#define MAS_DEPENDENCY_FUNC_GET_AUDIO_SOURCE_TYPE "mas_dependency_get_audio_source_type"
mas_dependency_start_recording start_recording;
mas_dependency_stop_recording stop_recording;
mas_dependency_set_recording_session set_recording_session;
- mas_dependency_change_system_volume change_system_volume;
- mas_dependency_recover_system_volume recover_system_volume;
+ mas_dependency_set_background_volume set_background_volume;
mas_dependency_get_audio_format get_audio_format;
mas_dependency_get_audio_source_type get_audio_source_type;
} mas_dependency;
void start_streaming_follow_up_data();
void stop_streaming_follow_up_data();
- void change_system_volume();
- void recover_system_volume();
+ void set_background_volume(double ratio);
private:
void add_audio_data(wakeup_speech_data& data, long time);
void notify_audio_data_recording(long time, void* data, int len);
bool update_voice_feedback_state(string appid, bool state);
bool send_assistant_specific_command(string appid, string command);
- bool change_system_volume(string appid, int event);
+ bool set_background_volume(string appid, double ratio);
bool update_recognition_result(string appid, int result);
bool process_event(ma_plugin_event_e event, void* data, int len);
bool get_audio_format(int* rate, int* channel, int* audio_type);
EXPORT_API int wakeup_manager_send_assistant_specific_command(const char* appid, const char* command);
-EXPORT_API int wakeup_manager_change_system_volume(const char *appid, int event);
+EXPORT_API int wakeup_manager_set_background_volume(const char *appid, double ratio);
EXPORT_API int wakeup_manager_update_recognition_result(const char *appid, int result);
g_mas_dependency.set_recording_session =
(mas_dependency_set_recording_session)dlsym(g_handle,
MAS_DEPENDENCY_FUNC_SET_RECORDING_SESSION);
- g_mas_dependency.change_system_volume =
- (mas_dependency_change_system_volume)dlsym(g_handle,
- MAS_DEPENDENCY_FUNC_CHANGE_SYSTEM_VOLUME);
- g_mas_dependency.recover_system_volume =
- (mas_dependency_recover_system_volume)dlsym(g_handle,
- MAS_DEPENDENCY_FUNC_RECOVER_SYSTEM_VOLUME);
+ g_mas_dependency.set_background_volume =
+ (mas_dependency_set_background_volume)dlsym(g_handle,
+ MAS_DEPENDENCY_FUNC_SET_BACKGROUND_VOLUME);
g_mas_dependency.get_audio_format =
(mas_dependency_get_audio_format)dlsym(g_handle,
MAS_DEPENDENCY_FUNC_GET_AUDIO_FORMAT);
return ret;
}
-int dependency_resolver_change_system_volume()
+int dependency_resolver_set_background_volume(double ratio)
{
int ret = -1;
if (NULL != g_handle) {
- mas_dependency_change_system_volume func = g_mas_dependency.change_system_volume;
+ mas_dependency_set_background_volume func = g_mas_dependency.set_background_volume;
if (NULL == func) {
- MAS_LOGE("[ERROR] symbol lookup failed : %s", MAS_DEPENDENCY_FUNC_CHANGE_SYSTEM_VOLUME);
+ MAS_LOGE("[ERROR] symbol lookup failed : %s", MAS_DEPENDENCY_FUNC_SET_BACKGROUND_VOLUME);
} else {
- ret = func();
- if (0 != ret) {
- MAS_LOGE("[ERROR] Fail to change system volume, ret(%d)", ret);
- }
- }
- } else {
- MAS_LOGE("[ERROR] g_handle is not valid");
- }
-
- return ret;
-}
-
-int dependency_resolver_recover_system_volume()
-{
- int ret = -1;
- if (NULL != g_handle) {
- mas_dependency_recover_system_volume func = g_mas_dependency.recover_system_volume;
- if (NULL == func) {
- MAS_LOGE("[ERROR] symbol lookup failed : %s", MAS_DEPENDENCY_FUNC_RECOVER_SYSTEM_VOLUME);
- } else {
- ret = func();
+ ret = func(ratio);
if (0 != ret) {
- MAS_LOGE("[ERROR] Fail to recover system volume, ret(%d)", ret);
+ MAS_LOGE("[ERROR] Fail to set background volume to %f, ret(%d)", ratio, ret);
}
}
} else {
mStopStreamingThread.store(false);
}
-void CAudioManager::change_system_volume()
+void CAudioManager::set_background_volume(double ratio)
{
- dependency_resolver_change_system_volume();
-}
-
-void CAudioManager::recover_system_volume()
-{
- dependency_resolver_recover_system_volume();
+ dependency_resolver_set_background_volume(ratio);
}
} // wakeup
return true;
}
-bool CWakeupManager::change_system_volume(string appid, int event)
+bool CWakeupManager::set_background_volume(string appid, double ratio)
{
- MWR_LOGD("[DEBUG] change system volume, system volume event(%d)", event);
+ MWR_LOGD("[DEBUG] set background volume (%f)", ratio);
int ret = 0;
- if (MA_SYSTEM_VOLUME_EVENT_CHANGE == event) {
- mAudioManager.change_system_volume();
- } else if (MA_SYSTEM_VOLUME_EVENT_RECOVER == event) {
- mAudioManager.recover_system_volume();
- }
-
+ mAudioManager.set_background_volume(ratio);
return ret;
}
return 0;
}
-int wakeup_manager_change_system_volume(const char* appid, int event)
+int wakeup_manager_set_background_volume(const char* appid, double ratio)
{
MWR_LOGD("[ENTER]");
appid_string = appid;
}
- g_wakeup_manager.change_system_volume(appid_string, event);
+ g_wakeup_manager.set_background_volume(appid_string, ratio);
MWR_LOGD("[END]");
return 0;
} else if (dbus_message_is_method_call(msg, MA_SERVER_SERVICE_INTERFACE, MA_METHOD_SEND_ASSISTANT_SPECIFIC_COMMAND)) {
ma_service_dbus_send_assistant_specific_command(g_conn_listener, msg);
- } else if (dbus_message_is_method_call(msg, MA_SERVER_SERVICE_INTERFACE, MA_METHOD_CHANGE_SYSTEM_VOLUME)) {
- ma_service_dbus_change_system_volume(g_conn_listener, msg);
+ } else if (dbus_message_is_method_call(msg, MA_SERVER_SERVICE_INTERFACE, MA_METHOD_SET_BACKGROUND_VOLUME)) {
+ ma_service_dbus_set_background_volume(g_conn_listener, msg);
} else if (dbus_message_is_method_call(msg, MA_SERVER_SERVICE_INTERFACE, MA_UI_METHOD_INITIALIZE)) {
ma_service_ui_dbus_initialize(g_conn_listener, msg);
return 0;
}
-int ma_service_dbus_change_system_volume(DBusConnection* conn, DBusMessage* msg)
+int ma_service_dbus_set_background_volume(DBusConnection* conn, DBusMessage* msg)
{
DBusError err;
dbus_error_init(&err);
int pid;
int ret = 0;
- int event;
+ double ratio;
dbus_message_get_args(msg, &err,
DBUS_TYPE_INT32, &pid,
- DBUS_TYPE_INT32, &event,
+ DBUS_TYPE_DOUBLE, &ratio,
DBUS_TYPE_INVALID);
- MAS_LOGD("[DEBUG] MAS CHANGE SYSTEM VOLUME");
+ MAS_LOGD("[DEBUG] MAS SET BACKGROUND VOLUME");
if (dbus_error_is_set(&err)) {
- MAS_LOGE("[IN ERROR] mas change system volume : Get arguments error (%s)", err.message);
+ MAS_LOGE("[IN ERROR] mas set background volume : Get arguments error (%s)", err.message);
dbus_error_free(&err);
ret = -1; //MAS_ERROR_OPERATION_FAILED;
} else {
- MAS_LOGD("[IN] mas change system volume : pid(%d), event(%d)", pid, event);
- ret = mas_client_change_system_volume(pid, event);
+ MAS_LOGD("[IN] mas set background volume : pid(%d), ratio(%f)", pid, ratio);
+ ret = mas_client_set_background_volume(pid, ratio);
}
MAS_LOGD("<<<<<");
int ma_service_dbus_send_assistant_specific_command(DBusConnection* conn, DBusMessage* msg);
-int ma_service_dbus_change_system_volume(DBusConnection* conn, DBusMessage* msg);
+int ma_service_dbus_set_background_volume(DBusConnection* conn, DBusMessage* msg);
int ma_service_ui_dbus_initialize(DBusConnection* conn, DBusMessage* msg);
return 0;
}
-int mas_client_change_system_volume(int pid, int event)
+int mas_client_set_background_volume(int pid, double ratio)
{
- multi_assistant_service_plugin_change_system_volume(NULL, event);
+ multi_assistant_service_plugin_set_background_volume(NULL, ratio);
return 0;
}
_wakeup_manager_interface.send_assistant_specific_command =
(wakeup_manager_send_assistant_specific_command)dlsym(g_handle,
MA_WAKEUP_MANAGER_FUNC_SEND_ASSISTANT_SPECIFIC_COMMAND);
- _wakeup_manager_interface.change_system_volume =
- (wakeup_manager_change_system_volume)dlsym(g_handle,
- MA_WAKEUP_MANAGER_FUNC_CHANGE_SYSTEM_VOLUME);
+ _wakeup_manager_interface.set_background_volume =
+ (wakeup_manager_set_background_volume)dlsym(g_handle,
+ MA_WAKEUP_MANAGER_FUNC_SET_BACKGROUND_VOLUME);
_wakeup_manager_interface.update_recognition_result =
(wakeup_manager_update_recognition_result)dlsym(g_handle,
MA_WAKEUP_MANAGER_FUNC_UPDATE_RECOGNITION_RESULT);
return ret;
}
-int multi_assistant_service_plugin_change_system_volume(const char* appid, int event)
+int multi_assistant_service_plugin_set_background_volume(const char* appid, double ratio)
{
int ret = -1;
if (NULL != g_handle) {
- wakeup_manager_change_system_volume func = _wakeup_manager_interface.change_system_volume;
+ wakeup_manager_set_background_volume func = _wakeup_manager_interface.set_background_volume;
if (NULL == func) {
- MAS_LOGE("[ERROR] symbol lookup failed : %s", MA_WAKEUP_MANAGER_FUNC_CHANGE_SYSTEM_VOLUME);
+ MAS_LOGE("[ERROR] symbol lookup failed : %s", MA_WAKEUP_MANAGER_FUNC_SET_BACKGROUND_VOLUME);
} else {
- ret = func(appid, event);
+ ret = func(appid, ratio);
if (0 != ret) {
- MAS_LOGE("[ERROR] Fail to change system volume, ret(%d)", ret);
+ MAS_LOGE("[ERROR] Fail to set background volume, ret(%d)", ret);
}
}
} else {