Enable agc, denoise, dereverb 05/260805/4
authorJaechul Lee <jcsing.lee@samsung.com>
Mon, 5 Jul 2021 02:07:06 +0000 (11:07 +0900)
committerJaechul Lee <jcsing.lee@samsung.com>
Tue, 6 Jul 2021 00:46:57 +0000 (09:46 +0900)
agc, denoise and dereverb are enabled to improve voice recognition ratio.

[Version] 0.13.12
[Issue Type] Add

Change-Id: Ib88c1afee0cd3f46b9c9e4833c8cc2db67f6fc14
Signed-off-by: Jaechul Lee <jcsing.lee@samsung.com>
aec/algo_speex.c
aec/loopback.c
packaging/libmm-sound.spec

index 60e762d..e20c6a7 100644 (file)
@@ -57,6 +57,7 @@ ec_operation_t *get_speex_instance()
 
 static int speex_init(int nframes, int rate, int channels)
 {
+       spx_int32_t value = 1;
        sp.nframes = nframes;
        sp.filter_frames = nframes; /* TODO:It takes much time when 10 times of nframe */
        sp.channels = channels;
@@ -83,6 +84,21 @@ static int speex_init(int nframes, int rate, int channels)
                return -1;
        }
 
+       if (speex_preprocess_ctl(sp.preprocess, SPEEX_PREPROCESS_SET_AGC, &value)) {
+               LOGE("speex_echo_ctl SPEEX_PREPROCESS_SET_AGC failed\n");
+               return -1;
+       }
+
+       if (speex_preprocess_ctl(sp.preprocess, SPEEX_PREPROCESS_SET_DENOISE, &value)) {
+               LOGE("speex_echo_ctl SPEEX_PREPROCESS_SET_DENOISE failed\n");
+               return -1;
+       }
+
+       if (speex_preprocess_ctl(sp.preprocess, SPEEX_PREPROCESS_SET_DEREVERB, &value)) {
+               LOGE("speex_echo_ctl SPEEX_PREPROCESS_SET_DEREVERB failed\n");
+               return -1;
+       }
+
        if (speex_preprocess_ctl(sp.preprocess, SPEEX_PREPROCESS_SET_ECHO_STATE, sp.echo_state)) {
                LOGE("speex_echo_ctl SET_ECHO_STATE failed\n");
                return -1;
index 305cc4a..3a6b63b 100644 (file)
@@ -908,7 +908,7 @@ static int __print_buffer(loopback_t *loopback)
                        loopback->name, capture, playback, sq_get_work_node_count(loopback->q));
 
        if (loopback->refq)
-               LOGE("refq delay(%d)", sq_get_work_node_count(loopback->refq));
+               LOGD("refq delay(%d)", sq_get_work_node_count(loopback->refq));
 
        return 0;
 }
index 968f2ed..a2f1879 100644 (file)
@@ -1,6 +1,6 @@
 Name:       libmm-sound
 Summary:    MMSound Package contains client lib and focus server binary
-Version:    0.13.11
+Version:    0.13.12
 Release:    0
 Group:      System/Libraries
 License:    Apache-2.0