
[Python] 음성인식(Speech Recognition) 과 TTS 구현 - 3
·
Python/Python
TTS with FastAPI FastAPI에서 TTS 구현 app/api/tts.py DB exist 체크로 생성되지 않았던 tts파일만 생성 하도록 되어있는데 사용량이 많다고 한다면 Insert가 많아지니 당연히 DB에 부담이 갈수 있다. 따라서, Redis Set로 저장하고 체크하는 것이 더 효율적으로 보인다. @router.get("/tts/{text}", response_class = FileResponse) async def get_tts_mp3(text: str, db: Session = Depends(get_db)): if not tts_record_repo.is_exist_tts_record(db, text): tts_record_repo.create_tts_record(db, text)..