Acquire recognition sound focus before starting STT 61/91861/1
authorsungwook79.park <sungwook79.park@samsung.com>
Wed, 12 Oct 2016 02:35:34 +0000 (11:35 +0900)
committersungwook79.park <sungwook79.park@samsung.com>
Wed, 12 Oct 2016 02:35:34 +0000 (11:35 +0900)
Change-Id: I662783dc5bfc6c3d7bb7700e7f77c1e218233310
Signed-off-by: sungwook79.park <sungwook79.park@samsung.com>
src/SttManager.cpp

index c4a080e..d8c53b5 100755 (executable)
@@ -140,9 +140,9 @@ void SttManager::Start() {
        asrtype = STT_RECOGNITION_TYPE_FREE_PARTIAL;
        int ret;
 
-       ret = sound_manager_acquire_focus(g_stream_info_h, SOUND_STREAM_FOCUS_FOR_PLAYBACK, NULL);
+       ret = sound_manager_acquire_focus(g_stream_info_h, (sound_stream_focus_mask_e)(SOUND_STREAM_FOCUS_FOR_PLAYBACK | SOUND_STREAM_FOCUS_FOR_RECORDING), NULL);
        if (SOUND_MANAGER_ERROR_NONE != ret) {
-               LOGW("Fail to acquire focus. ret : %d, stream handle : %p", ret, g_stream_info_h);
+               LOGW("Fail to acquire playback or recording focus. ret : %d, stream handle : %p", ret, g_stream_info_h);
        }
 
        ret = stt_start(handle, language.c_str(), asrtype.c_str());
@@ -554,8 +554,8 @@ void SttManager::EnableSilenceDetection(bool enabled) {
 
 void SttManager::ReleaseSoundFocus()
 {
-       int ret = sound_manager_release_focus(g_stream_info_h, SOUND_STREAM_FOCUS_FOR_PLAYBACK, NULL);
+       int ret = sound_manager_release_focus(g_stream_info_h, (sound_stream_focus_mask_e)(SOUND_STREAM_FOCUS_FOR_PLAYBACK | SOUND_STREAM_FOCUS_FOR_RECORDING), NULL);
        if (SOUND_MANAGER_ERROR_NONE != ret) {
-               LOGW("Fail to release focus. ret : %d", ret);
+               LOGW("Fail to release playback or recording focus. ret : %d", ret);
        }
 }