mirror of
https://github.com/signalwire/freeswitch.git
synced 2026-10-28 14:14:16 +00:00
FS-7654 #resolve
This commit is contained in:
1 parent
3e2d5e009e
commit
d6a0abf1db
4 files changed
+55
-22
No files matched your search
@@ -228,18 +228,20 @@ SWITCH_DECLARE(void) switch_generate_sln_silence(int16_t *data, uint32_t samples
|
||||
}
|
||||
}
|
||||
|
||||
SWITCH_DECLARE(uint32_t) switch_merge_sln(int16_t *data, uint32_t samples, int16_t *other_data, uint32_t other_samples)
|
||||
SWITCH_DECLARE(uint32_t) switch_merge_sln(int16_t *data, uint32_t samples, int16_t *other_data, uint32_t other_samples, int channels)
|
||||
{
|
||||
int i;
|
||||
int32_t x, z;
|
||||
|
||||
if (channels == 0) channels = 1;
|
||||
|
||||
if (samples > other_samples) {
|
||||
x = other_samples;
|
||||
} else {
|
||||
x = samples;
|
||||
}
|
||||
|
||||
for (i = 0; i < x; i++) {
|
||||
for (i = 0; i < x * channels; i++) {
|
||||
z = data[i] + other_data[i];
|
||||
switch_normalize_to_16bit(z);
|
||||
data[i] = (int16_t) z;
|
||||
@@ -249,18 +251,20 @@ SWITCH_DECLARE(uint32_t) switch_merge_sln(int16_t *data, uint32_t samples, int16
|
||||
}
|
||||
|
||||
|
||||
SWITCH_DECLARE(uint32_t) switch_unmerge_sln(int16_t *data, uint32_t samples, int16_t *other_data, uint32_t other_samples)
|
||||
SWITCH_DECLARE(uint32_t) switch_unmerge_sln(int16_t *data, uint32_t samples, int16_t *other_data, uint32_t other_samples, int channels)
|
||||
{
|
||||
int i;
|
||||
int32_t x;
|
||||
|
||||
if (channels == 0) channels = 1;
|
||||
|
||||
if (samples > other_samples) {
|
||||
x = other_samples;
|
||||
} else {
|
||||
x = samples;
|
||||
}
|
||||
|
||||
for (i = 0; i < x; i++) {
|
||||
for (i = 0; i < x * channels; i++) {
|
||||
data[i] -= other_data[i];
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user