From f5d97f2fb365b4ffea7eb8644338f4fdc32d794c Mon Sep 17 00:00:00 2001 From: Anthony Minessale Date: Mon, 23 Mar 2009 01:59:35 +0000 Subject: [PATCH] make gaussian noise less noisy FSCORE-340 git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@12720 d0543943-73ff-0310-b7d9-9358b9ac24b2 --- src/switch_ivr_originate.c | 2 +- src/switch_resample.c | 10 ++++------ 2 files changed, 5 insertions(+), 7 deletions(-) diff --git a/src/switch_ivr_originate.c b/src/switch_ivr_originate.c index 90f1f46153..f58a52d1fc 100644 --- a/src/switch_ivr_originate.c +++ b/src/switch_ivr_originate.c @@ -1871,7 +1871,7 @@ SWITCH_DECLARE(switch_status_t) switch_ivr_originate(switch_core_session_t *sess silence = ringback.silence; } } else { - silence = 400; + silence = 600; } if ((ringback.fh || silence || ringback.audio_buffer) && write_frame.codec && write_frame.datalen) { diff --git a/src/switch_resample.c b/src/switch_resample.c index 736c4f2150..a4777b2eb0 100644 --- a/src/switch_resample.c +++ b/src/switch_resample.c @@ -181,24 +181,22 @@ SWITCH_DECLARE(void) switch_swap_linear(int16_t *buf, int len) } } -#if SILENCE_METHOD_ONE +#if 1 SWITCH_DECLARE(void) switch_generate_sln_silence(int16_t *data, uint32_t samples, uint32_t divisor) { int16_t x; uint32_t i; int sum_rnd = 0; - int16_t rnd2 = (int16_t) switch_micro_time_now(); + int16_t rnd2 = (int16_t) switch_micro_time_now() + (int16_t) (intptr_t) data; assert(divisor); - - for (i = 0; i < samples; i++, sum_rnd = 0) { for (x = 0; x < 6; x++) { rnd2 = rnd2 * 31821U + 13849U; - sum_rnd += rnd2; + sum_rnd += rnd2 ; } - switch_normalize_to_16bit(sum_rnd); + //switch_normalize_to_16bit(sum_rnd); *data = (int16_t) ((int16_t) sum_rnd / (int) divisor); data++;