Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

May I ask why the audio length after noise reduction is inconsistent #31

Open
Marootc opened this issue Jun 14, 2024 · 2 comments
Open

Comments

@Marootc
Copy link

Marootc commented Jun 14, 2024

The duration of the denoised audio is inconsistent. May I ask what the problem is? I am currently working on saving the denoised audio locally, but there is a discrepancy between the denoised audio and the original audio
`def denoise_audio(audio_path, output_path):
dwav, sr = torchaudio.load(audio_path)
dwav = dwav.mean(dim=0)
wav_denoised, _ = denoise(dwav, sr, device)
if wav_denoised.ndim == 1:
wav_denoised = wav_denoised.unsqueeze(0)

wav_denoised_tensor = torch.from_numpy(wav_denoised.cpu().numpy())


sf.write(output_path, wav_denoised_tensor.T, 24000)`

Uploading WX20240614-231737.png…

@Marootc
Copy link
Author

Marootc commented Jun 14, 2024

WX20240614-231737

@boin
Copy link

boin commented Nov 22, 2024

denoise returns a sample rate
sf.write(output_path, wav_denoised_tensor.T, [use the return sample rate here] )`

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants