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) {
+ int device_id;
+
+ if ((errorCode = sound_manager_get_echo_cancel_reference_device(stream_info, &device_id) != 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_id != SOUND_MANAGER_STREAM_NO_REFERENCE_DEVICE)
+ getAudioInfo().bindEchoCancelReferenceDeviceId(device_id);
+ }
}