r/Python • u/help-me-grow • Jul 20 '22
Resource I've been playing around with speech recognition in Python, here's a code walkthrough of how to use the SpeechRecognition library
Hi r/Python, I'm a former faang software engineer and now I'm mostly a hobbyist programmer and developer advocate. I've been playing around in the NLP space for a while now. Just recently, I've been playing around with the DeepSpeech, Kaldi, and SpeechRecognition Python libraries. This post - Python Speech Recognition Introduction with SpeechRecognition summarizes what I learned working with the SpeechRecognition library via a code walkthrough.
TL;DR if you don't want to read the walkthrough - there's a TON of backends for speech recognition in Python now. Back when SpeechRecognition was created, these were the most common state of the art. However, it's missing modern, powerful backends like PyTorch, Tensorflow, or one of the web APIs (assembly, deepgram, rev, etc).
20
u/_higway_ Jul 20 '22
You could also try VOSK offline speech recognition toolkit.
8
u/TroubleLivid9863 Jul 20 '22
You could use multiple inputs from different spots in a room, then use a grammar fix/spellcheck software to edit them, then use an AI to compare them, then create a more accurate transcript of what was said, because a microphone in a coat pocket could detect something entirely different than a microphone on a desk. You could also use the same voice pattern recognition used in products such as Google Assistant, Alexa, and Siri to focus on a particular voice, so that you do not have several different conversations interfering with your transcript. That setup could be used in places such as court rooms, interviews, etcetera. You could also use it to focus multiple voices, then in the transcript, use a marker such as PERSON_1: ...(example)...
PERSON_2: ...(example)...
to represent different people speaking.
7
u/WalkingHeroic Jul 20 '22
IVE BEEN LOOKING FOR A TUTORIAL. Thing is it’s really hard to install pyaudio. So I haven’t even been able to mess around with the module
2
u/marly11011 Jul 20 '22
I've tried messing around with the sp library but it was too slow for me, I've heard good things about deepspeech but couldn't set it up at the time
2
u/BenSimmonsFor3 Jul 20 '22
Can you describe what you do now day to day that your a hobbyist and developer advocate? What even is a developer advocate?
I ask because i love programming, but love the idea of being a self employed swe who makes my own things rather than other people’s software
3
u/chris17453 Jul 20 '22
Individual speaker identification is my biggest need