#include <string.h>
#include "CAudioIODef.h"
+#include <sound_manager.h>
+#include <sound_manager_internal.h>
using namespace std;
using namespace tizen_media_audio;
__mSampleType(ESampleType::SAMPLE_TYPE_U8),
__mAudioType(EAudioType::AUDIO_IN_TYPE_MEDIA),
__mAudioIndex(-1),
- __mReferenceDeviceId(0) {
+ __mEffectMethodWithReference((sound_effect_method_with_reference_e)0),
+ __mEffectMethodReferenceDeviceId(0),
+ __mEffectMethod(0) {
}
CAudioInfo::CAudioInfo(unsigned int sampleRate, EChannel channel, ESampleType sampleType, EAudioType audioType, int audioIndex) :
__mSampleType(sampleType),
__mAudioType(audioType),
__mAudioIndex(audioIndex),
- __mReferenceDeviceId(0) {
+ __mEffectMethodWithReference((sound_effect_method_with_reference_e)0),
+ __mEffectMethodReferenceDeviceId(0),
+ __mEffectMethod(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;
+void CAudioInfo::setEffectMethod(int method) noexcept {
+ __mEffectMethod = method;
}
-int CAudioInfo::getEchoCancelReferenceDeviceId() noexcept {
- return __mReferenceDeviceId;
+std::string CAudioInfo::getEffectMethod() noexcept {
+ std::string method;
+
+ if (__mEffectMethod & SOUND_EFFECT_NOISE_SUPPRESSION_VOIP)
+ method += "ns-rnnoise,";
+
+ if (__mEffectMethod & SOUND_EFFECT_NOISE_SUPPRESSION_VOICE_RECOGNITION)
+ method += "ns-pse,";
+
+ if (__mEffectMethod & SOUND_EFFECT_NOISE_SUPPRESSION_DOORBELL)
+ method += "ns-srid,";
+
+ if (__mEffectMethod & SOUND_EFFECT_AUTOMATIC_GAIN_CONTROL_CAPTURE)
+ method += "agc-speex,";
+
+ return method;
+}
+
+void CAudioInfo::setEffectMethodWithReference(sound_effect_method_with_reference_e method, int id) noexcept {
+ __mEffectMethodWithReference = method;
+ __mEffectMethodReferenceDeviceId = id;
+}
+
+std::pair<std::string, int> CAudioInfo::getEffectMethodWithReference() noexcept {
+ std::string method;
+
+ if (__mEffectMethodWithReference == SOUND_EFFECT_REFERENCE_COPY)
+ method += "reference_copy,";
+ else if (__mEffectMethodWithReference == SOUND_EFFECT_ACOUSTIC_ECHO_CANCEL_SPEEX)
+ method += "aec-speex,";
+ else if (__mEffectMethodWithReference == SOUND_EFFECT_ACOUSTIC_ECHO_CANCEL_WEBRTC)
+ method += "aec-webrtc,";
+
+ return make_pair(method, __mEffectMethodReferenceDeviceId);
}
const char* CAudioInfo::getConvertedStreamType() {