audio_manager->stop_streaming_follow_up_data();
audio_manager->stop_recording(true);
audio_manager->clear_audio_data();
- audio_manager->set_recording_session(RECORDING_SESSION_WAKE_WORD);
- audio_manager->start_recording(true);
break;
}
wakeup_manager->set_streaming_mode(STREAMING_MODE::NONE);
if (WAKEUP_MANAGER_STATE_UTTERANCE == wakeup_manager->get_manager_state()) {
+ audio_manager->stop_recording(true);
+ audio_manager->set_recording_session(RECORDING_SESSION_WAKE_WORD);
+ if (engine_manager->get_audio_data_required()) {
+ /* Restart recorder thread using appropriate recording device */
+ audio_manager->start_recording(true);
+ }
wakeup_manager->change_manager_state(WAKEUP_MANAGER_STATE_PROCESSING);
}
}
if (WAKEUP_MANAGER_STATE_UTTERANCE == mWakeupManagerState) {
change_manager_state(WAKEUP_MANAGER_STATE_PROCESSING);
+ mAudioManager.stop_recording(true);
mAudioManager.set_recording_session(RECORDING_SESSION_WAKE_WORD);
+ if (mWakeupEngineManager.get_audio_data_required()) {
+ /* Restart recorder thread using appropriate recording device */
+ mAudioManager.start_recording(true);
+ }
}
mStreamingMode = STREAMING_MODE::NONE;
if (WAKEUP_MANAGER_STATE_UTTERANCE == mWakeupManagerState) {
change_manager_state(WAKEUP_MANAGER_STATE_PROCESSING);
+ mAudioManager.stop_recording(true);
+ mAudioManager.set_recording_session(RECORDING_SESSION_WAKE_WORD);
+ if (mWakeupEngineManager.get_audio_data_required()) {
+ /* Restart recorder thread using appropriate recording device */
+ mAudioManager.start_recording(true);
+ }
}
mStreamingMode = STREAMING_MODE::NONE;
- mAudioManager.stop_recording(true);
mAudioManager.clear_audio_data();
- mAudioManager.set_recording_session(RECORDING_SESSION_WAKE_WORD);
- mAudioManager.start_recording(true);
MWR_LOGD("[END]");
return true;
for (const auto& observer : observers) {
observer->on_streaming_audio_data(event, buffer, len);
}
- if (MAS_SPEECH_STREAMING_EVENT_FINISH == event) {
- mWakeupManager->set_streaming_mode(STREAMING_MODE::NONE);
- mWakeupManager->stop_streaming_duration_timer();
- }
return true;
}