Phase 12: Improve audio transitions and verify sample-accurate timing
This commit is contained in:
parent
461689dd44
commit
05140c2e93
29 changed files with 795 additions and 33 deletions
|
|
@ -1,3 +1,4 @@
|
|||
#include "xtc/xtc_dsp.h"
|
||||
#include "../graph/graph_internal.h"
|
||||
#include <math.h>
|
||||
#include <stdlib.h>
|
||||
|
|
@ -234,8 +235,7 @@ xtc_result xtc_plan_process_stereo(xtc_plan *plan, const float *input, const flo
|
|||
if (spec.type == XTC_NODE_GAIN)
|
||||
sample *= spec.value;
|
||||
}
|
||||
if (!isfinite(sample))
|
||||
sample = 0.0f;
|
||||
sample = xtc_dsp_finite(sample);
|
||||
buffer[frame] = sample;
|
||||
if (fabsf(sample) > peak)
|
||||
peak = fabsf(sample);
|
||||
|
|
@ -269,7 +269,7 @@ xtc_result xtc_plan_process_stereo(xtc_plan *plan, const float *input, const flo
|
|||
for (index = 0U; index < plan->node_count; ++index)
|
||||
if (plan->render[index])
|
||||
sample += plan->buffers[(channel * plan->node_count + index) * plan->max_frames + frame];
|
||||
destination[frame] = isfinite(sample) ? sample : 0.0f;
|
||||
destination[frame] = xtc_dsp_finite(sample);
|
||||
}
|
||||
}
|
||||
plan->position += frame_count;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue