return bytes_in_sample * static_cast<int>(__mChannel);
}
-void CAudioInfo::bindEchoCancelReferenceDeviceId(int id) noexcept {
+void CAudioInfo::bindEchoCancelReferenceDeviceId(int id, sound_acoustic_echo_cancel_type_e type) {
+ if (type == SOUND_ACOUSTIC_ECHO_CANCEL_VOICE_CALL)
+ __mProcessorProperty += "webrtc,";
+ else if (type == SOUND_ACOUSTIC_ECHO_CANCEL_REFERENCE_COPY)
+ __mProcessorProperty += "reference_copy,";
+ else
+ THROW_ERROR_MSG_FORMAT(CAudioError::EError::ERROR_NOT_SUPPORTED_TYPE,
+ "The echo cancel is not supported [type:%d]", type);
+
__mReferenceDeviceId = id;
}
return __mReferenceDeviceId;
}
-void CAudioInfo::setNoiseSuppression(bool enable) noexcept {
+void CAudioInfo::setNoiseSuppression(bool enable, sound_noise_suppression_type_e type) {
+ if (type == SOUND_NOISE_SUPPRESSION_VOICE_CALL) {
+ __mProcessorProperty += "rnnoise,";
+ } else if (type == SOUND_NOISE_SUPPRESSION_VOICE_RECOGNITION) {
+ __mProcessorProperty += "pse,";
+ } else {
+ THROW_ERROR_MSG_FORMAT(CAudioError::EError::ERROR_NOT_SUPPORTED_TYPE,
+ "The noise suppression type is not supported [type:%d]", type);
+ }
+
__mNoiseSuppression = enable;
}
-bool CAudioInfo::getNoiseSuppression() noexcept {
- return __mNoiseSuppression;
+std::string& CAudioInfo::getProcessorProperty() noexcept {
+ return __mProcessorProperty;
}
const char* CAudioInfo::getConvertedStreamType() {