CoolFace
Apppublic

Coder19/interview_system

sourceHugging Faceupdated 1y agoView on Hugging Face
0likes
speech_to_txt.py21 linesDownload Raw Back to api
1 2from fastapi import FastAPI3# from interview_select.emotion import get_face_emotion4# from interview_select.speech_text import speech_to_text5# from interview_select.text_to_speech import text_to_speech6from interview_select.interview_bot import *7from interview_select.interview_session import *8from fastapi import APIRouter9import json10 11 12router = APIRouter()13 14@router.post("/speech-to-text/")15async def speech_to_text_route():16    """Converts speech to text"""17    response = speech_to_text()18    if response:19        return {"text": response}20    else:21        return {"error": "Unable to convert speech to text."}