Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -33,7 +33,7 @@ REFERENCE_CHANNEL = 0
|
|
33 |
#creating a random noise for better calculations
|
34 |
SAMPLE_NOISE = download_asset("tutorial-assets/mvdr/noise.wav")
|
35 |
waveform_noise, sr2 = torchaudio.load(SAMPLE_NOISE)
|
36 |
-
waveform_noise = waveform_noise.to(torch.
|
37 |
stft_noise = stft(waveform_noise)
|
38 |
|
39 |
def ui():
|
@@ -44,14 +44,14 @@ def ui():
|
|
44 |
|
45 |
if audio_file is not None:
|
46 |
waveform_clean,sr=torchaudio.load(audio_file)
|
47 |
-
waveform_clean = waveform_clean.to(torch.
|
48 |
stft_clean = stft(waveform_clean)
|
49 |
st.text("Your uploaded audio")
|
50 |
st.audio(audio_file)
|
51 |
#creating a mixture of our audio file and the noise file
|
52 |
waveform_mix = generate_mixture(waveform_clean, waveform_noise, target_snr)
|
53 |
#making the files into torch double format
|
54 |
-
|
55 |
#computing STFT
|
56 |
stft_mix = stft(waveform_mix)
|
57 |
#plotting the spectogram
|
|
|
33 |
#creating a random noise for better calculations
|
34 |
SAMPLE_NOISE = download_asset("tutorial-assets/mvdr/noise.wav")
|
35 |
waveform_noise, sr2 = torchaudio.load(SAMPLE_NOISE)
|
36 |
+
waveform_noise = waveform_noise.to(torch.float32)
|
37 |
stft_noise = stft(waveform_noise)
|
38 |
|
39 |
def ui():
|
|
|
44 |
|
45 |
if audio_file is not None:
|
46 |
waveform_clean,sr=torchaudio.load(audio_file)
|
47 |
+
waveform_clean = waveform_clean.to(torch.float32)
|
48 |
stft_clean = stft(waveform_clean)
|
49 |
st.text("Your uploaded audio")
|
50 |
st.audio(audio_file)
|
51 |
#creating a mixture of our audio file and the noise file
|
52 |
waveform_mix = generate_mixture(waveform_clean, waveform_noise, target_snr)
|
53 |
#making the files into torch double format
|
54 |
+
waveform_mix = waveform_mix.to(torch.float32)
|
55 |
#computing STFT
|
56 |
stft_mix = stft(waveform_mix)
|
57 |
#plotting the spectogram
|