concierge-apis / core /interface /stt_client /google_client.py
yashmakan's picture
files added
bf2bf0e
raw
history blame contribute delete
257 Bytes
from io import BytesIO
import speech_recognition as sr
def stt_client(audio_data: bytes):
r = sr.Recognizer()
with sr.AudioFile(BytesIO(audio_data)) as source:
audio = r.record(source)
text = r.recognize_google(audio)
return text