Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -47,9 +47,10 @@ def generate_audio():
|
|
| 47 |
).audios
|
| 48 |
|
| 49 |
# Create a temporary file to store the generated audio
|
|
|
|
| 50 |
with tempfile.NamedTemporaryFile(delete=False, suffix=".wav") as tmpfile:
|
| 51 |
# Write the audio to the temporary file
|
| 52 |
-
sf.write(tmpfile.name,
|
| 53 |
|
| 54 |
# Store the temporary file path
|
| 55 |
temp_file_path = tmpfile.name
|
|
|
|
| 47 |
).audios
|
| 48 |
|
| 49 |
# Create a temporary file to store the generated audio
|
| 50 |
+
output_audio = audio_output[0].T.float().cpu().numpy()
|
| 51 |
with tempfile.NamedTemporaryFile(delete=False, suffix=".wav") as tmpfile:
|
| 52 |
# Write the audio to the temporary file
|
| 53 |
+
sf.write(tmpfile.name, output_audio, pipe.vae.sampling_rate)
|
| 54 |
|
| 55 |
# Store the temporary file path
|
| 56 |
temp_file_path = tmpfile.name
|