Skip to content

Commit cc580ad

Browse files
committed
[common] update the common code to work with the new streaming api.
This is just an interim until I rework the buffer code to stream directly into the library
1 parent a443c81 commit cc580ad

File tree

2 files changed

+4
-7
lines changed

2 files changed

+4
-7
lines changed

src/common/src/RnNoiseCommonPlugin.cpp

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -168,12 +168,9 @@ void RnNoiseCommonPlugin::process(const float *in, float *out, int32_t sampleFra
168168
leftLen = k_denoiseFrameSize;
169169
const int rightLen = k_denoiseFrameSize - leftLen;
170170

171-
rnnoise_process_frame(
172-
m_denoiseState.get(),
173-
&m_outBuffer[m_outBufferW],
174-
&m_inBuffer[m_inBufferR], leftLen,
175-
&m_inBuffer[0] , rightLen
176-
);
171+
rnnoise_add_samples (m_denoiseState.get(), &m_inBuffer[m_inBufferR], leftLen );
172+
rnnoise_add_samples (m_denoiseState.get(), &m_inBuffer[0] , rightLen);
173+
rnnoise_process_frame(m_denoiseState.get(), &m_outBuffer[m_outBufferW]);
177174

178175
// scale the levels back to normal
179176
for(int32_t i = 0; i < k_denoiseFrameSize; ++i)

src/rnnoise/src/denoise.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -483,7 +483,7 @@ int rnnoise_add_samples(DenoiseState *st, const float *in, int in_len) {
483483
const int needed = FRAME_SIZE - st->input_pos;
484484
const int take = needed > in_len ? in_len : needed;
485485

486-
biquad(st->input + st->input_pos, st->mem_hp_x, in, b_hp, a_hp, in_len);
486+
biquad(st->input + st->input_pos, st->mem_hp_x, in, b_hp, a_hp, take);
487487
return take;
488488
}
489489

0 commit comments

Comments
 (0)