X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=src%2Fcpp%2FCAudioIO.cpp;h=093e7c21065b2262edf96ece6f7b80346b61f57a;hb=d8f886d5fb8f2a155ad19e44b88304cf0a7cfc30;hp=7565f6b53556b2eb802b476ec9110ffbcaa2ec81;hpb=1d93cf72472d684867b8ae7b7e4eb10ca6988f8d;p=platform%2Fcore%2Fapi%2Faudio-io.git diff --git a/src/cpp/CAudioIO.cpp b/src/cpp/CAudioIO.cpp index 7565f6b..093e7c2 100644 --- a/src/cpp/CAudioIO.cpp +++ b/src/cpp/CAudioIO.cpp @@ -223,4 +223,20 @@ void CAudioIO::setStreamInfo(sound_stream_info_h stream_info) { if ((errorCode = sound_manager_get_index_from_stream_information(stream_info, &index)) != SOUND_MANAGER_ERROR_NONE) THROW_ERROR_MSG_FORMAT(CAudioError::EError::ERROR_INVALID_ARGUMENT, "Parameter stream_info->index is invalid [ret:%d]", errorCode); //LCOV_EXCL_LINE getAudioInfo().setAudioIndex(index); + + if (mDirection == CAudioInfo::EAudioDirection::AUDIO_DIRECTION_IN) { + sound_device_h device = NULL; + + if ((errorCode = sound_manager_get_echo_cancel_reference_device(stream_info, &device) != SOUND_MANAGER_ERROR_NONE)) + THROW_ERROR_MSG_FORMAT(CAudioError::EError::ERROR_INVALID_ARGUMENT, "Can't get reference device [ret:%d]", errorCode); //LCOV_EXCL_LINE + + if (device) { + int id; + + if ((errorCode = sound_manager_get_device_id(device, &id) != SOUND_MANAGER_ERROR_NONE)) + THROW_ERROR_MSG_FORMAT(CAudioError::EError::ERROR_INVALID_OPERATION, "Can't get device id [ret:%d]", errorCode); //LCOV_EXCL_LINE + + getAudioInfo().bindEchoCancelReferenceDeviceId(id); + } + } }