mirror of
https://github.com/BoardWare-Genius/jarvis-models.git
synced 2025-12-13 16:53:24 +00:00
fix: remove mp3 data
This commit is contained in:
@ -1,5 +1,5 @@
|
|||||||
from fastapi import Response, status
|
from fastapi import Response, status
|
||||||
from fastapi.responses import FileResponse, JSONResponse
|
from fastapi.responses import JSONResponse
|
||||||
from blackbox.blackbox import Blackbox
|
from blackbox.blackbox import Blackbox
|
||||||
from gtts import gTTS
|
from gtts import gTTS
|
||||||
from io import BytesIO
|
from io import BytesIO
|
||||||
@ -26,4 +26,4 @@ class TextToAudio(Blackbox):
|
|||||||
if text is None:
|
if text is None:
|
||||||
return JSONResponse(content={"error": "text is required"}, status_code=status.HTTP_400_BAD_REQUEST)
|
return JSONResponse(content={"error": "text is required"}, status_code=status.HTTP_400_BAD_REQUEST)
|
||||||
by = self.processing(text)
|
by = self.processing(text)
|
||||||
return Response(content=by.read(), media_type="audio/mpeg", headers={"Content-Disposition": "attachment; filename=audio.mp3"})
|
return Response(content=by.read(), media_type="audio/mp3", headers={"Content-Disposition": "attachment; filename=audio.mp3"})
|
||||||
Reference in New Issue
Block a user