xiph/rnnoise

RNNoise not doing anything, result is identical to original

DatCaptainHorse opened this issue · 6 comments

I'm using RNNoise yoinked from OBS-Studio repo as that works on Windows. RNNoise works on OBS-Studio really well, but when I try to use it in my own program it has no effect at all, I tried having my tower fan blow right towards the mic as I speak and play random noises from phone.

Captured audio format is mono 32-bit float, 480 size frames. Code snippet below:

auto st = rnnoise_create(nullptr);

int stopCap = 0;
std::vector<float> resRNN, resNone;
while (stopCap == 0) {
	std::vector<float> tmp;
	auto samples = captureAudio(&tmp);
	if (samples > 0) {
		for (const auto& t : tmp) resNone.emplace_back(t);
		rnnoise_process_frame(st, tmp.data(), tmp.data());
		for (const auto& t : tmp) resRNN.emplace_back(t);
	}
	stopCap = kbhit();
}

I output the data to PCM files and imported them into Audacity, comparing them show that they are the same.

kuva

Did you solve this problem?

Did you solve this problem?

Nope, didn't manage to find a way to get it to work unfortunately.

I also met the same problem. Have you solved it yet?

Unfortunately no

I also met the same problem. Have you solved it yet?

rnnoise has got a quite odd value range. It expects the float sample to be in the range of signed 16bit.
If your samples are between -1 and 1 rnnoise just sees silence and keeps all gains open, which results the output to be equal to the input.

rnnoise has got a quite odd value range. It expects the float sample to be in the range of signed 16bit. If your samples are between -1 and 1 rnnoise just sees silence and keeps all gains open, which results the output to be equal to the input.

Well that explains some things.. remapping float ranges is bit ugly but it seems to work. (Upper is voice with background noise, lower is after running it through rnnoise). Thanks for letting us know of this!
Picture