Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion audiolib.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions noisyspeech_synthesizer.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion noisyspeech_synthesizer.py
Original file line number Diff line number Diff line change
Expand Up @@ -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':
Expand Down
10 changes: 5 additions & 5 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -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