I have a project in which I have created a chat program between a client and host, and I have to embed Speech to Text in it. Is there any way by which I can embed Google Speech to Text API in my program ??
I have a project in which I have created a chat program between a client and host, and I have to embed Speech to Text in it. Is there any way by which I can embed Google Speech to Text API in my program ??
There is a package in PyPI called Speech Recognition which looks like it will do this. The live (i.e. via microphone) API looks fantastically simple.
# NOTE: this requires PyAudio because it uses the Microphone class
import speech_recognition as sr
r = sr.Recognizer()
with sr.Microphone() as source: # use the default microphone as the audio sourceaudio = r.listen(source) # listen for the first phrase and extract it into audio datatry:print("You said " + r.recognize(audio)) # recognize speech using Google Speech Recognition
except LookupError: # speech is unintelligibleprint("Could not understand audio")
It also has capabilities for transcribing WAV files, running as a background process, providing confidence values for the transcription, etc.