Spaces:
Running
on
Zero
Running
on
Zero
Update app.py
Browse files
app.py
CHANGED
@@ -14,8 +14,11 @@ def fn_clearvoice(aud):
|
|
14 |
enhanced = enhance_model.enhance_batch(noisy, lengths=torch.tensor([1.]))
|
15 |
"""
|
16 |
output_wav_dict = myClearVoice(input_path='input.wav', online_write=False)
|
17 |
-
|
18 |
-
|
|
|
|
|
|
|
19 |
torchaudio.save('enhanced.wav', output_wav.cpu(), 16000)
|
20 |
return 'enhanced.wav'
|
21 |
|
|
|
14 |
enhanced = enhance_model.enhance_batch(noisy, lengths=torch.tensor([1.]))
|
15 |
"""
|
16 |
output_wav_dict = myClearVoice(input_path='input.wav', online_write=False)
|
17 |
+
if isinstance(output_wav_dict, dict):
|
18 |
+
key = next(iter(output_wav_dict))
|
19 |
+
output_wav = output_wav_dict[key]
|
20 |
+
else:
|
21 |
+
output_wav = output_wav_dict
|
22 |
torchaudio.save('enhanced.wav', output_wav.cpu(), 16000)
|
23 |
return 'enhanced.wav'
|
24 |
|