From eb1c183dc66625bcb50ef700045b3044ca54cdf0 Mon Sep 17 00:00:00 2001 From: Ji-hoon Lee Date: Fri, 8 Nov 2019 15:02:09 +0900 Subject: [PATCH] Fix bug recording_session is not changed properly Change-Id: Ia2ad3c215cb6bb2b2f65872122d3c4b8aff33115 --- plugins/wakeup-manager/src/wakeup_manager.cpp | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/plugins/wakeup-manager/src/wakeup_manager.cpp b/plugins/wakeup-manager/src/wakeup_manager.cpp index ece33b9..1fa4387 100644 --- a/plugins/wakeup-manager/src/wakeup_manager.cpp +++ b/plugins/wakeup-manager/src/wakeup_manager.cpp @@ -422,6 +422,9 @@ bool CWakeupManager::set_background_volume(string appid, double ratio) bool CWakeupManager::update_recognition_result(string appid, int result) { MWR_LOGD("[ENTER]"); + if (WAKEUP_MANAGER_STATE_UTTERANCE == mWakeupManagerState) { + mAudioManager.set_recording_session(RECORDING_SESSION_WAKE_WORD); + } mWakeupEngineManager.update_recognition_result(appid, result); if (WAKEUP_MANAGER_STATE_PROCESSING == mWakeupManagerState || WAKEUP_MANAGER_STATE_UTTERANCE == mWakeupManagerState) { @@ -893,20 +896,24 @@ bool CWakeupManager::CEngineEventObserver::on_audio_streaming_data_section( void CWakeupManager::CPolicyEventObserver::on_wakeup(wakeup_event_info wakeup_info) { if (nullptr == mWakeupManager) return; + + CAudioManager *audio_manager = mWakeupManager->get_audio_manager(); + CWakeupEngineManager *engine_manager = mWakeupManager->get_engine_manager(); + if (nullptr == audio_manager || nullptr == engine_manager) return; + mWakeupManager->stop_streaming_utterance_data(); mWakeupManager->stop_streaming_previous_utterance_data(); mWakeupManager->stop_streaming_follow_up_data(); mWakeupManager->change_manager_state(WAKEUP_MANAGER_STATE_UTTERANCE); - CWakeupEngineManager *engine_manager = mWakeupManager->get_engine_manager(); - if (nullptr == engine_manager) return; - mWakeupManager->set_last_wakeup_event_info(wakeup_info); engine_manager->set_selected_wakeup_info(wakeup_info); vector observers = mWakeupManager->get_wakeup_observers(); for (const auto& observer : observers) { observer->on_wakeup(wakeup_info); } + + audio_manager->set_recording_session(RECORDING_SESSION_UTTERANCE); } bool CWakeupManager::CAudioEventObserver::on_recording_audio_data(long time, void* data, int len) -- 2.7.4