Add get ns/agc function 76/300376/1 accepted/tizen/unified/20231101.174518 accepted/tizen/unified/riscv/20231211.043615
authorJaechul Lee <jcsing.lee@samsung.com>
Mon, 23 Oct 2023 08:01:18 +0000 (17:01 +0900)
committerJaechul Lee <jcsing.lee@samsung.com>
Mon, 23 Oct 2023 08:01:18 +0000 (17:01 +0900)
AGC should be applied at the end of the pipe. So it should be separated
and set to the property.

[Version] 0.5.65
[Issue Type] Update

Change-Id: I35bde1c564d7d5a36efd972916d3a5e3bf659556
Signed-off-by: Jaechul Lee <jcsing.lee@samsung.com>
include/CAudioInfo.h
packaging/capi-media-audio-io.spec
src/cpp/CAudioInfo.cpp
src/cpp/CPulseAudioClient.cpp

index fbe2439..3a86f07 100644 (file)
@@ -149,7 +149,8 @@ namespace tizen_media_audio {
 
         /* Effect */
         void setEffectMethod(int method) noexcept;
-        std::string getEffectMethod() const noexcept;
+        std::string getEffectNoiseSuppressionMethod() const noexcept;
+        std::string getEffectAutomaticGainControlMethod() const noexcept;
 
         void setEffectMethodWithReference(sound_effect_method_with_reference_e method, int id) noexcept;
         std::pair<std::string, int> getEffectMethodWithReference() const noexcept;
index c0ddac4..ff806c1 100644 (file)
@@ -1,6 +1,6 @@
 Name:           capi-media-audio-io
 Summary:        An Audio Input & Audio Output library in Tizen Native API
-Version:        0.5.64
+Version:        0.5.65
 Release:        0
 Group:          Multimedia/API
 License:        Apache-2.0
index 8cf23d4..099451b 100644 (file)
@@ -116,7 +116,7 @@ void CAudioInfo::setEffectMethod(int method) noexcept {
     __mEffectMethod = method;
 }
 
-std::string CAudioInfo::getEffectMethod() const noexcept {
+std::string CAudioInfo::getEffectNoiseSuppressionMethod() const noexcept {
     std::string method;
 
     if (__mEffectMethod & SOUND_EFFECT_NOISE_SUPPRESSION_VOIP)
@@ -128,6 +128,12 @@ std::string CAudioInfo::getEffectMethod() const noexcept {
     if (__mEffectMethod & SOUND_EFFECT_NOISE_SUPPRESSION_DOORBELL)
         method += "ns-srid,";
 
+    return method;
+}
+
+std::string CAudioInfo::getEffectAutomaticGainControlMethod() const noexcept {
+    std::string method;
+
     if (__mEffectMethod & SOUND_EFFECT_AUTOMATIC_GAIN_CONTROL_CAPTURE)
         method += "agc-speex,";
 
index 7c1796a..d143d94 100644 (file)
@@ -400,9 +400,11 @@ void CPulseAudioClient::initialize() {
 
         if (__mDirection == EStreamDirection::STREAM_DIRECTION_RECORD) {
             /* Noise-suppression effect should be set first. */
-            std::string method = __mSpec.getAudioInfo().getEffectMethod();
+            std::string ns_method = __mSpec.getAudioInfo().getEffectNoiseSuppressionMethod();
             auto [ method_reference, device_id ] = __mSpec.getAudioInfo().getEffectMethodWithReference();
-            std::string method_all = method + method_reference;
+            std::string agc_method = __mSpec.getAudioInfo().getEffectAutomaticGainControlMethod();
+
+            std::string method_all = ns_method + method_reference + agc_method;
 
             if (!method_all.empty()) {
                 pa_proplist_setf(__mpPropList, PA_PROP_MEDIA_PREPROCESSOR_METHOD, "%s", method_all.c_str());