Add echo-cancel properties to AudioInfo
[platform/core/api/audio-io.git] / src / cpp / CAudioInfo.cpp
index f35f3f4..d35b37f 100644 (file)
@@ -40,7 +40,8 @@ CAudioInfo::CAudioInfo(unsigned int sampleRate, EChannel channel, ESampleType sa
     __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)
@@ -121,6 +122,14 @@ int CAudioInfo::getSampleSize() noexcept {
     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)
@@ -150,4 +159,4 @@ CAudioInfo::EAudioType CAudioInfo::convertOutputStreamTypeToAudioType(const char
     }
     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
+}