Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
|
@@ -43,10 +43,9 @@ def summarize_and_speech(pdf_file):
|
|
| 43 |
tts_output = synthesiser(summary)
|
| 44 |
audio_data = tts_output["audio"][0]
|
| 45 |
|
| 46 |
-
|
| 47 |
-
|
| 48 |
-
|
| 49 |
-
audio_bytes = audio_bytes.read()
|
| 50 |
|
| 51 |
return summary, audio_bytes
|
| 52 |
|
|
|
|
| 43 |
tts_output = synthesiser(summary)
|
| 44 |
audio_data = tts_output["audio"][0]
|
| 45 |
|
| 46 |
+
with BytesIO() as buffer:
|
| 47 |
+
sf.write(buffer, audio_data, 16000, format='wav')
|
| 48 |
+
audio_bytes = buffer.getvalue()
|
|
|
|
| 49 |
|
| 50 |
return summary, audio_bytes
|
| 51 |
|