mirror of
https://github.com/signalwire/freeswitch.git
synced 2025-03-13 12:40:17 +00:00
make gaussian noise less noisy FSCORE-340
git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@12720 d0543943-73ff-0310-b7d9-9358b9ac24b2
This commit is contained in:
parent
377043e0ef
commit
f5d97f2fb3
@ -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) {
|
||||
|
@ -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++;
|
||||
|
Loading…
x
Reference in New Issue
Block a user