redsky17 commited on
Commit
8b9a956
·
verified ·
1 Parent(s): 3499494

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -1
app.py CHANGED
@@ -146,7 +146,8 @@ def process_audio(
146
  # Save output
147
  progress(0.9, desc="Saving output...")
148
  output_path = tempfile.NamedTemporaryFile(delete=False, suffix=".wav").name
149
- torchaudio.save(output_path, audio, sr)
 
150
 
151
  # Get info
152
  duration = audio.shape[1] / sr
 
146
  # Save output
147
  progress(0.9, desc="Saving output...")
148
  output_path = tempfile.NamedTemporaryFile(delete=False, suffix=".wav").name
149
+ # Save using soundfile instead of torchaudio
150
+ sf.write(output_path, audio.squeeze().numpy().T, sr)
151
 
152
  # Get info
153
  duration = audio.shape[1] / sr