Spaces:
Running
Running
Update apis/chat_api.py
Browse files- apis/chat_api.py +2 -1
apis/chat_api.py
CHANGED
@@ -111,7 +111,8 @@ class ChatAPIApp:
|
|
111 |
audioobj.write_to_fp(mp3_fp)
|
112 |
#buffer = bytearray(mp3_fp.read())
|
113 |
#base64EncodedStr = base64.encodebytes(buffer)
|
114 |
-
|
|
|
115 |
except gtts.tts.gTTSError as err:
|
116 |
item_response = {
|
117 |
"status": 400
|
|
|
111 |
audioobj.write_to_fp(mp3_fp)
|
112 |
#buffer = bytearray(mp3_fp.read())
|
113 |
#base64EncodedStr = base64.encodebytes(buffer)
|
114 |
+
mp3_fp.read()
|
115 |
+
return Response(content=mp3_fp.tell(), media_type="audio/mpeg")
|
116 |
except gtts.tts.gTTSError as err:
|
117 |
item_response = {
|
118 |
"status": 400
|