diff --git a/audiolib.py b/audiolib.py index cd999efe..ad0ec248 100644 --- a/audiolib.py +++ b/audiolib.py @@ -65,7 +65,7 @@ def snr_mixer(clean, noise, snr): rmsnoise = (noise**2).mean()**0.5 # Set the noise level for a given SNR - noisescalar = np.sqrt(rmsclean / (10**(snr/20)) / rmsnoise) + noisescalar = rmsclean / (10**(snr/20)) / rmsnoise noisenewlevel = noise * noisescalar noisyspeech = clean + noisenewlevel return clean, noisenewlevel, noisyspeech diff --git a/noisyspeech_synthesizer.cfg b/noisyspeech_synthesizer.cfg index 71992c01..5ea8c513 100644 --- a/noisyspeech_synthesizer.cfg +++ b/noisyspeech_synthesizer.cfg @@ -21,8 +21,8 @@ audio_length: 10 silence_length: 0.2 total_hours: 1 snr_lower: 0 -snr_upper: 40 -total_snrlevels: 5 +snr_upper: 20 +total_snrlevels: 5 noise_dir: None speech_dir: None diff --git a/noisyspeech_synthesizer.py b/noisyspeech_synthesizer.py index 86c136e1..6874a9ca 100644 --- a/noisyspeech_synthesizer.py +++ b/noisyspeech_synthesizer.py @@ -12,7 +12,7 @@ def main(cfg): snr_lower = float(cfg["snr_lower"]) snr_upper = float(cfg["snr_upper"]) - total_snrlevels = float(cfg["total_snrlevels"]) + total_snrlevels = int(cfg["total_snrlevels"]) clean_dir = os.path.join(os.path.dirname(__file__), 'clean_train') if cfg["speech_dir"]!='None': diff --git a/requirements.txt b/requirements.txt index 26a7ee99..b74458bb 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,5 +1,5 @@ -numpy==1.22.4 -glob2==0.7 -soundfile==0.11.0 -scipy==1.6.2 -configparser==5.3.0 +numpy +glob2 +soundfile +scipy +configparser \ No newline at end of file