From 4038fdf80c6f0492333e72cdd893ff43a9f6abd4 Mon Sep 17 00:00:00 2001 From: Ji-hoon Lee Date: Wed, 24 Jul 2019 16:16:42 +0900 Subject: [PATCH] Adjust pcm_wait_count value Change-Id: I531fba2647588a45a160fe20fa7331183f98ff77 --- plugins/wakeup-manager/src/wakeup_audio_manager.cpp | 5 ++++- plugins/wakeup-manager/src/wakeup_engine_manager.cpp | 5 ++++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/plugins/wakeup-manager/src/wakeup_audio_manager.cpp b/plugins/wakeup-manager/src/wakeup_audio_manager.cpp index 7e3e305..d6c1868 100644 --- a/plugins/wakeup-manager/src/wakeup_audio_manager.cpp +++ b/plugins/wakeup-manager/src/wakeup_audio_manager.cpp @@ -11,6 +11,9 @@ namespace multiassistant namespace wakeup { +/* 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() { auto now = chrono::system_clock::now(); @@ -169,7 +172,7 @@ void CAudioManager::streaming_audio_data_thread_func(long start_time) MWR_LOGI("[INFO] Resume thread"); break; } - if (200 < cnt) { + if (g_speech_pcm_wait_count < cnt) { MWR_LOGE("[ERROR] Wrong request, there's no pcm data"); for (const auto& observer : mObservers) { if (observer) { diff --git a/plugins/wakeup-manager/src/wakeup_engine_manager.cpp b/plugins/wakeup-manager/src/wakeup_engine_manager.cpp index 32d226b..e5f76ed 100644 --- a/plugins/wakeup-manager/src/wakeup_engine_manager.cpp +++ b/plugins/wakeup-manager/src/wakeup_engine_manager.cpp @@ -11,6 +11,9 @@ namespace multiassistant namespace wakeup { +/* Need to check whether this value needs to be configurable */ +static int g_speech_pcm_wait_count = 400; + /* Utility function for checking if an element exists in a container */ template static auto contains(const C& v, const T& x) -> decltype(end(v), true) @@ -167,7 +170,7 @@ void CWakeupEngineManager::streaming_speech_data_thread_func() MWR_LOGI("[INFO] Resume thread"); break; } - if (200 < cnt) { + if (g_speech_pcm_wait_count < cnt) { MWR_LOGE("[ERROR] Wrong request, there's no pcm data"); for (const auto& observer : mObservers) { if (observer) { -- 2.7.4