Commit b4b615ad authored by Quentin Aristote's avatar Quentin Aristote
Browse files

corrected mono conversion

parent ef0981f9
......@@ -19,7 +19,8 @@ def soundToSpectrogram(path, sample_rate = 16000, duration = 30) :
waveform, orig_freq = torchaudio.load(path)
# Convert to mono
waveform[:] = waveform.mean(dim = 0)
waveform_mono = waveform.mean(dim = 0)
waveform = torch.stack([waveform_mono.detach(), waveform_mono.detach()])
# Resample
resample = transforms.Resample(orig_freq = orig_freq, new_freq = sample_rate)
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment