Skip to content

Instantly share code, notes, and snippets.

@carlfm01
Last active December 11, 2019 03:47
Show Gist options
  • Save carlfm01/c8f49562b97a66fea1a72d23d1259b7d to your computer and use it in GitHub Desktop.
Save carlfm01/c8f49562b97a66fea1a72d23d1259b7d to your computer and use it in GitHub Desktop.
rnnoiseresample
for (size_t n = 0; n < totalFrameCnt / 160; n++) {
get_frame_f32(pWavIn, frameIn, 160);
float *input = (float *)malloc(480 * sizeof(float));
float *output = (float *)malloc(160 * sizeof(float));
//Upsample from 16KHz to 48KHz
Resample_f32(frameIn, input, 16000, 48000, 160, 1);
float prob = rnnoise_process(pRnnoise, frameOut, input);
if (isOutput) {
//Downsmaple back to 16KHz
Resample_f32(frameOut, output, 48000, 16000, 480, 1);
write_frames_f32(pWavOut, 160, output);
}
free(input);
free(output);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment