Finalize audio data when voice key is in pressed state 45/216745/1
authorJi-hoon Lee <dalton.lee@samsung.com>
Thu, 31 Oct 2019 11:16:18 +0000 (20:16 +0900)
committerJi-hoon Lee <dalton.lee@samsung.com>
Thu, 31 Oct 2019 11:17:43 +0000 (20:17 +0900)
When audio is finalized after voice key variable is
set to false, the FINISH audio event will be fed to
wakeup engines where the event itself is not useful
for wakeup engines.

Change-Id: Ifdd41be5e76a84b779d697edefd57203ac2bfe5a

plugins/wakeup-manager/src/wakeup_manager.cpp

index 9e16d367e3de030bda8764ebd5a134f1bbc028b9..1ac4694b0d1e8504e401ca93f330d67e4fda5d40 100644 (file)
@@ -491,8 +491,8 @@ bool CWakeupManager::process_event(ma_plugin_event_e event, void* data, int len)
                }
        } else if (MA_PLUGIN_EVENT_VOICE_KEY_RELEASED_AFTER_PUSH == event) {
                if (mVoiceKeyPressed != false) {
-                       mVoiceKeyPressed = false;
                        mAudioManager.finalize_audio_data();
+                       mVoiceKeyPressed = false;
 
                        if (mWakeupEngineManager.get_audio_data_required()) {
                                /* Restart recorder thread using appropriate recording device */