mirror of
https://github.com/signalwire/freeswitch.git
synced 2025-08-13 17:38:59 +00:00
shhhh
git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@4716 d0543943-73ff-0310-b7d9-9358b9ac24b2
This commit is contained in:
@@ -183,6 +183,27 @@ SWITCH_DECLARE(void) switch_swap_linear(int16_t *buf, int len)
|
||||
}
|
||||
}
|
||||
|
||||
SWITCH_DECLARE(void) switch_generate_sln_silence(int16_t *data, uint32_t samples, uint32_t divisor)
|
||||
{
|
||||
int16_t rnd, x,i;
|
||||
uint32_t sum_rnd = 0;
|
||||
|
||||
assert(divisor);
|
||||
|
||||
for(i = 0; i < samples; i++, sum_rnd = 0) {
|
||||
for(x = 0; x < 7; x++) {
|
||||
rnd = (int16_t) (rand() * sizeof(int16_t));
|
||||
sum_rnd += rnd;
|
||||
}
|
||||
switch_normalize_to_16bit(sum_rnd);
|
||||
*data = (int16_t) sum_rnd;
|
||||
*data /= (int)divisor;
|
||||
|
||||
data++;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
SWITCH_DECLARE(void) switch_change_sln_volume(int16_t *data, uint32_t samples, int32_t vol)
|
||||
{
|
||||
double newrate = 0;
|
||||
|
Reference in New Issue
Block a user