#define MA_METHOD_SET_PREPROCESSING_ALLOW_MODE "ma_method_set_preprocessing_allow_mode"
#define MA_METHOD_SEND_PREPROCESSING_RESULT "ma_method_send_preprocessing_result"
#define MA_METHOD_SET_WAKE_WORD_AUDIO_REQUIRE_FLAG "ma_method_set_wake_word_audio_require_flag"
-#define MA_METHOD_SET_ASSISTANT_LANGUAGE "ma_method_set_assistant_language"
+#define MA_METHOD_SET_ASSISTANT_WAKEUP_LANGUAGE "ma_method_set_assistant_wakeup_language"
#define MA_METHOD_ERROR "ma_method_error"
#define MA_UI_METHOD_INITIALIZE "ma_ui_method_initialize"
<?xml version="1.0" encoding="utf-8" ?>
-<manifest xmlns="http://tizen.org/ns/packages" api-version="5.0" package="org.tizen.multi-assistant-service" version="0.2.28">
+<manifest xmlns="http://tizen.org/ns/packages" api-version="5.0" package="org.tizen.multi-assistant-service" version="0.2.29">
<label>Multi Assistant Service</label>
<author email="wn.jang@samsung.com" href="www.samsung.com">Won Nam Jang</author>
<author email="sooyeon.kim@samsung.com" href="www.samsung.com">Sooyeon Kim</author>
Name: org.tizen.multi-assistant-service
Summary: Multi assistant service
-Version: 0.2.28
+Version: 0.2.29
Release: 1
Group: Graphics & UI Framework/Voice Framework
License: Flora-1.1
static thread g_recorder_thread;
static atomic_bool g_stop_recorder_thread{false};
-static long get_current_milliseconds_after_epoch()
+static long long get_current_milliseconds_after_epoch()
{
- auto now = chrono::system_clock::now();
+ auto now = chrono::steady_clock::now();
auto now_ms = chrono::time_point_cast<chrono::milliseconds>(now);
/* number of milliseconds since the epoch of system_clock */
auto value = now_ms.time_since_epoch();
void finalize_audio_data();
void clear_audio_data();
- void start_streaming_current_utterance_data(long start_time = 0);
+ void start_streaming_current_utterance_data(long long start_time = 0);
void stop_streaming_current_utterance_data();
void start_streaming_previous_utterance_data();
void set_background_volume(double ratio);
private:
- void add_audio_data(mas_speech_data& data, long time);
+ void add_audio_data(mas_speech_data& data, long long time);
void notify_audio_data_recording(long time, void* data, int len);
void streaming_previous_audio_data_thread_func();
- void streaming_audio_data_thread_func(long start_time);
+ void streaming_audio_data_thread_func(long long start_time);
int mSoundFocusWatchId{0};
bool mRecordingRequired{false};
thread mStreamingPreviousThread;
atomic_bool mStopStreamingPreviousThread{false};
- static constexpr long mAudioRecordingDurationMilliseconds = 10 * 1000;
+ static constexpr long long mAudioRecordingDurationMilliseconds = 10 * 1000;
typedef struct {
- long time;
+ long long time;
mas_speech_data data;
} mas_speech_data_with_time;
vector<mas_speech_data_with_time> mPreviousAudioData;
/* Need to check whether this value needs to be configurable */
static int g_speech_pcm_wait_count = 800;
-static long get_current_milliseconds_after_epoch()
+static long long get_current_milliseconds_after_epoch()
{
- auto now = chrono::system_clock::now();
+ auto now = chrono::steady_clock::now();
auto now_ms = chrono::time_point_cast<chrono::milliseconds>(now);
/* number of milliseconds since the epoch of system_clock */
auto value = now_ms.time_since_epoch();
MWR_LOGI("[EXIT]");
}
-void CAudioManager::streaming_audio_data_thread_func(long start_time)
+void CAudioManager::streaming_audio_data_thread_func(long long start_time)
{
MWR_LOGI("[ENTER]");
MWR_LOGI("[EXIT]");
}
-void CAudioManager::add_audio_data(mas_speech_data& data, long time)
+void CAudioManager::add_audio_data(mas_speech_data& data, long long time)
{
- long delta = mAudioRecordingDurationMilliseconds;
+ long long delta = mAudioRecordingDurationMilliseconds;
notify_audio_data_recording(time, data.buffer, data.len);
mas_speech_data speech_data;
speech_data.buffer = vm_malloc_simple(len);
if (speech_data.buffer) {
- long time = get_current_milliseconds_after_epoch();
+ long long time = get_current_milliseconds_after_epoch();
speech_data.event = event;
speech_data.len = len;
speech_data.len = sizeof(final_buffer);
speech_data.buffer = vm_malloc_simple(speech_data.len);
if (speech_data.buffer) {
- long time = get_current_milliseconds_after_epoch();
+ long long time = get_current_milliseconds_after_epoch();
memcpy(speech_data.buffer, final_buffer, speech_data.len);
add_audio_data(speech_data, time);
}
}
-void CAudioManager::start_streaming_current_utterance_data(long start_time)
+void CAudioManager::start_streaming_current_utterance_data(long long start_time)
{
if (mStreamingThread.joinable()) {
MWR_LOGE("ERROR : mStreamingThread is joinable, will not start a new thread");
#endif
/* Need to check whether this value needs to be configurable */
-static int g_speech_pcm_wait_count = 400;
+static int g_speech_pcm_wait_count = 800;
/* Utility function for checking if an element exists in a container */
template<class C, class T>
return true;
}
-static long get_current_milliseconds_after_epoch()
+static long long get_current_milliseconds_after_epoch()
{
- auto now = chrono::system_clock::now();
+ auto now = chrono::steady_clock::now();
auto now_ms = chrono::time_point_cast<chrono::milliseconds>(now);
/* number of milliseconds since the epoch of system_clock */
auto value = now_ms.time_since_epoch();
} else if (dbus_message_is_method_call(msg, MA_SERVER_SERVICE_INTERFACE, MA_METHOD_SET_WAKE_WORD_AUDIO_REQUIRE_FLAG)) {
ma_service_dbus_set_wake_word_audio_require_flag(g_conn_listener, msg);
- } else if (dbus_message_is_method_call(msg, MA_SERVER_SERVICE_INTERFACE, MA_METHOD_SET_ASSISTANT_LANGUAGE)) {
+ } else if (dbus_message_is_method_call(msg, MA_SERVER_SERVICE_INTERFACE, MA_METHOD_SET_ASSISTANT_WAKEUP_LANGUAGE)) {
ma_service_dbus_set_assistant_language(g_conn_listener, msg);
} else if (dbus_message_is_method_call(msg, MA_SERVER_SERVICE_INTERFACE, MA_UI_METHOD_INITIALIZE)) {
return -1;
}
+ memset(&g_maclient_info, 0x00, sizeof(g_maclient_info));
+ g_current_maclient_info = -1;
+ g_current_preprocessing_maclient_info = -1;
+ g_wakeup_maclient_appid = NULL;
+
if (0 == mas_config_get_assistant_info(__mas_assistant_info_cb, NULL)) {
for (int loop = 0; loop < MAX_MACLIENT_INFO_NUM; loop++) {
int inner_loop;
if (0 == multi_assistant_service_plugin_get_default_assistant(&default_assistant)) {
for (int loop = 0; loop < MAX_MACLIENT_INFO_NUM; loop++) {
if (g_maclient_info[loop].used) {
- if (strncmp(default_assistant, g_maclient_info[loop].appid, MAX_APPID_LEN) == 0) {
+ if (default_assistant &&
+ strncmp(default_assistant, g_maclient_info[loop].appid, MAX_APPID_LEN) == 0) {
float duration = g_maclient_info[loop].voice_key_tap_duration;
if (0.0f < duration) {
multi_assistant_service_plugin_set_voice_key_tap_duration(duration);