int getAudioIndex() noexcept;
void setAudioIndex(int audioIndex) noexcept;
int getSampleSize() noexcept;
+ void bindEchoCancelReferenceDeviceId(int id) noexcept;
+ int getEchoCancelReferenceDeviceId() noexcept;
/* Setter & Getter Utilities */
const char* getConvertedStreamType();
ESampleType __mSampleType;
EAudioType __mAudioType;
int __mAudioIndex;
+ int __mReferenceDeviceId;
};
Name: capi-media-audio-io
Summary: An Audio Input & Audio Output library in Tizen Native API
-Version: 0.5.44
+Version: 0.5.45
Release: 0
Group: Multimedia/API
License: Apache-2.0
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);
+ }
+ }
}
__mChannel(channel),
__mSampleType(sampleType),
__mAudioType(audioType),
- __mAudioIndex(audioIndex) {
+ __mAudioIndex(audioIndex),
+ __mReferenceDeviceId(0) {
// Check to invalid AudioInfo
if (sampleRate < CAudioInfo::MIN_SYSTEM_SAMPLERATE ||
sampleRate > CAudioInfo::MAX_SYSTEM_SAMPLERATE)
return bytes_in_sample * static_cast<int>(__mChannel);
}
+void CAudioInfo::bindEchoCancelReferenceDeviceId(int id) noexcept {
+ __mReferenceDeviceId = id;
+}
+
+int CAudioInfo::getEchoCancelReferenceDeviceId() noexcept {
+ return __mReferenceDeviceId;
+}
+
const char* CAudioInfo::getConvertedStreamType() {
if (__mAudioType < CAudioInfo::EAudioType::AUDIO_IN_TYPE_MEDIA ||
__mAudioType >= CAudioInfo::EAudioType::AUDIO_TYPE_MAX)
}
THROW_ERROR_MSG_FORMAT(CAudioError::EError::ERROR_NOT_SUPPORTED_TYPE,
"The streamType of output is not supported [streamType:%s]", streamType);
-}
\ No newline at end of file
+}
* class CPulseAudioClient
*/
const char* CPulseAudioClient::CLIENT_NAME = "AUDIO_IO_PA_CLIENT";
+const char* ec_method = "default";
static constexpr auto drain_wait_interval = 10000;
static constexpr auto drain_wait_max_count = 30;
if (index >= 0)
pa_proplist_setf(__mpPropList, PA_PROP_MEDIA_PARENT_ID, "%u", (unsigned int) index);
+ int reference_id = __mSpec.getAudioInfo().getEchoCancelReferenceDeviceId();
+ if (reference_id > 0) {
+ pa_proplist_setf(__mpPropList, PA_PROP_MEDIA_ECHO_CANCEL_METHOD, "%s", ec_method);
+ pa_proplist_setf(__mpPropList, PA_PROP_MEDIA_ECHO_CANCEL_REFERENCE_DEVICE, "%d", reference_id);
+ }
+
// Adds latency on proplist for delivery to PULSEAUDIO
AUDIO_IO_LOGD("LATENCY : %s[%d]", __mSpec.getStreamLatencyToString(), static_cast<int>(__mSpec.getStreamLatency()));
pa_proplist_setf(__mpPropList, PA_PROP_MEDIA_TIZEN_AUDIO_LATENCY, "%s", __mSpec.getStreamLatencyToString());