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

denoised audio doesn't sound right #5

Open
kevin-farhat opened this issue May 18, 2024 · 2 comments
Open

denoised audio doesn't sound right #5

kevin-farhat opened this issue May 18, 2024 · 2 comments

Comments

@kevin-farhat
Copy link

Not sure why but the denoised audio sounds like cut off sounds or little pulses of sound that have nothing to do with the original audio. The original audio is a speaker with some background noise, but the output sounds as if someone is plugging in and out their electric guitar really quickly (like the speaker pop sound). I am new to this so I do not understand the underlying tech, but why does the generateNoiseProfile function overwrite the input audio file. Should i be passing the input audio file to the generateNoiseProfile function? without calling generateNoiseProfile, my input and output audio sounds the exact same. I am also getting the warnings below, but I believe I read somewhere that the divide by 0 error is okay. Any explanation of how to use this properly and what might be causing my problems would be appreciated.

Thank you for the help!

UserWarning: Level value of 2 is too high: all coefficients will experience boundary effects.
  warnings.warn(s]
                      /home/ubuntu/.local/lib/python3.9/site-packages/pywt/_thresholding.py:22: RuntimeWarning: invalid value encountered in divide
  thresholded = (1 - value/magnitude)
@ap-atul
Copy link
Owner

ap-atul commented May 19, 2024

you don't need to do generateNoiseProfile

@kevin-farhat
Copy link
Author

Thank you for your response. When I don't do generateNoiseProfile, the output audio is the same as the input audio with no noise reduction.

This is the script i'm using:

import os
from tqdm import tqdm 

# input_dir = '/home/ubuntu/denoising/DNS_data/datasets_fullband/noisy_audios'
input_dir = '/home/ubuntu/denoising/audios/noisy_audios'

output_dir = '/home/ubuntu/kevin/denoising/Audio-Denoising/'

os.makedirs(output_dir, exist_ok=True)

wav_files = [f for f in os.listdir(input_dir) if f.endswith('.wav')]

for file in tqdm(wav_files):
    in_audio_file = os.path.join(input_dir, file)
    out_audio_file = os.path.join(output_dir, f"results2/denoised_{file}")
    print(in_audio_file)
    print(out_audio_file)
    audioDenoiser = AudioDeNoise(inputFile=in_audio_file)
    audioDenoiser.deNoise(outputFile=f"{out_audio_file}")
    # audioDenoiser.generateNoiseProfile(noiseFile=in_audio_file)```

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