mirror of
https://github.com/ZDoom/fluidsynth.git
synced 2025-01-19 07:50:49 +00:00
fix for ticket #87: Noise when using more than 1 stereo channel
This commit is contained in:
parent
ad23ded3e3
commit
07711903a3
1 changed files with 8 additions and 1 deletions
|
@ -2905,7 +2905,7 @@ fluid_synth_nwrite_float(fluid_synth_t* synth, int len,
|
|||
fluid_real_t** left_in;
|
||||
fluid_real_t** right_in;
|
||||
double time = fluid_utime();
|
||||
int i, num, available, count, bytes;
|
||||
int i, j, num, available, count, bytes;
|
||||
float cpu_load;
|
||||
|
||||
if (!synth->eventhandler->is_threadsafe)
|
||||
|
@ -2922,8 +2922,15 @@ fluid_synth_nwrite_float(fluid_synth_t* synth, int len,
|
|||
bytes = num * sizeof(float);
|
||||
|
||||
for (i = 0; i < synth->audio_channels; i++) {
|
||||
#ifdef WITH_FLOAT
|
||||
FLUID_MEMCPY(left[i], left_in[i] + synth->cur, bytes);
|
||||
FLUID_MEMCPY(right[i], right_in[i] + synth->cur, bytes);
|
||||
#else //WITH_FLOAT
|
||||
for (j = 0; j < num; j++) {
|
||||
left[i][j] = (float) left_in[i][j + synth->cur];
|
||||
right[i][j] = (float) right_in[i][j + synth->cur];
|
||||
}
|
||||
#endif //WITH_FLOAT
|
||||
}
|
||||
count += num;
|
||||
num += synth->cur; /* if we're now done, num becomes the new synth->cur below */
|
||||
|
|
Loading…
Reference in a new issue