radinhas commited on
Commit
c36683d
1 Parent(s): 1ff0ace

Update apis/chat_api.py

Browse files
Files changed (1) hide show
  1. apis/chat_api.py +5 -4
apis/chat_api.py CHANGED
@@ -109,11 +109,12 @@ class ChatAPIApp:
109
  mp3_fp = BytesIO()
110
  #audioobj.save(fileName)
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
119
  }
 
109
  mp3_fp = BytesIO()
110
  #audioobj.save(fileName)
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
+ return buffer
117
+ except:
118
  item_response = {
119
  "status": 400
120
  }