Thank You everyone for watching this video! It took me time to make this project so I am really happy that people take interest in it! So again Thanks! And If You liked the video Leave a like or if You have any questions You can always reach me on discord!
Hello. Thanks for taking the time to detail this! My Dad is 85yrs old, lives mostly alone and he has very bad hearing so he requires hearing aids to hear most things. But at night he does not wear them. So he cannot hear his house alarm system if there is a warning of a fire, intrusion, etc. I have set up voice-activated (VOC) intercom by his alarm station in the hall and a receiver intercom by his bed which will transmit anything the alarm and/or a remote, live alarm person says such as asking him "is everything is ok?". But again he can't really hear unless he puts his hearing aids in which takes time assuming he even knows to do this. So I have purchased a heavy-duty industrial vibrator I plan to mount to his bed frame and I plan to have the alarm speaker voltage act as a signal to a relay to turn on the vibrator if the alarm is going off. (actually, the alarm is so high-pitched he can't even hear it with his hearing aids in even when right next to it. And despite it being SO loud most people can't take more than 10 seconds or so before saying "please turn it off!") So I'd really like to have something that, after vibrating him awake would transcribe what is being said on the bed-side intercom and then project it on his bedroom wall (using a cheap $100 video projector) so he can "hear"/read what is being said by the alarm or someone on another home intercom. But this is something that would have to be on all day or at least at night without fail as I can't really rely on him to remember to turn it on, type commands to start a program, etc. each night. Do you have any thoughts on how this could be done? I should mention I am a mech engineer who has worked on Pi-related projects but I have no real hands-on experience with them. Well, thanks for reading! - Jim
Hi, this speech recognition seems great! Can we use the same way for offline voice assistant? For example : in a situation when your internet connection is broken down for a while... How to solve it? Thanks!
Hey, thank You for watching it! So this model is fully internet dependable, since the recognition models are in Google web speech API and this project sends info there. So to make it not internet dependable You would need to train Your own speech recognition models in the same local computer, which is I have to say kinda harder :D, again thanks for watching! And maybe I will try to make offline version in the future!
Hey, thanks for watching! So in that case I had same problems and I haven't tried fixing them, but I thought that "try" "except" case should work, tho I am not sure.
Hey, Yes first response takes time, but after the first response it is connected to the server and then the response speed depends on Your internet speed. As I said mine was about 2 seconds for each response. I hope this helped!
@@Audas101 thanks man! I think my internet was not helping too...but now its working very well! Your tutorial is incredible and help me a lot ! Good job ! 👏
There are special commans in Raspbian for that, You can try google them. Or (as I did for myself) You can download screen capturing program in which You can record Your screen and voice and later on watch it
This video is fantastic, that's exactly What I was searching for! But to be honest, I would be sooo happy if you would like to do the version without recording the audio to optimize the recognition time! :D Would be great to see the video with this better version too! :D BTW. Can this programm work while "Smart mirror program" is running? :D
Hey, first of all thanks for watching! So I will try to optimize this in the future! however the part that takes the most time is communicating with server, but I will try to make a version with local voice recognition model which will definitely improve the speed! And I am not sure about the smart mirror thing, but I am pretty sure it is possible to fuse them :D Again thanks for watching!
My raspberry pi is not recording my voice i connected the mic using USB sound card all are recognised by raspberry pi but not working I have tried lots of ways like resetting the alsa mixer but it didn't work iam using raspberry pi 3 B+.... the mic and sound card are working perfectly in the pc
Hey! Thanks for watching! To prevent errors or, to be more specific, to define the errors you could you a "try, except" command or you could absolutely stop the audio reading and sending to the web speech API.
@@Audas101 Thank you for your reply ! the try command worked! how to stop audio playback? and do you know how i can access the pygame library? I would like to remove the print of start program
hi the code is amazing but i have a problem when running the code I get a error like microphone is not defined what I can do (I am using a mems microphone allocated to card 0)
Hey, thanks. Have You tried checking if You really are detecting any sound from Your mic? And also You can check via python which mic is being used, there is a simple command for that, but i can't recall it now. i Haven't had this problem in particular, so I don't know this helps or not, but try playing more with Alsamixer settings, cause that helped me a lot.
So I don't realy know about the hat, but my method is using the USB so it instantly understands the mic. With hat mic would probably go through GPIO and i am not quite sure how raspberry reacts there. But you can check Alsa if it sees the mic. And if it does detect it then most likely everything stays the same for the code part
Ah sorry about the link, I updated it now so should be ok in an hour or so. And yes it works with USB mic or to be more precise it works with USB sound card, which let's You connect microphone and headphones.
I want to ask a question Can I just buy a cheap plastic sound card and can use my regular earphones (usual earphones) mic just by entering the earphone's jack in the sound card mic input? and if I don't need other things just speech recognition and prints what I said then do I need anything else alongside with the soundcard? please answer really need to know
great work man ......sometime I get error like this ..... raceback (most recent call last): File "/home/pi/voice recg.py", line 18, in words = r.recognize_google(audio) File "/usr/local/lib/python3.7/dist-packages/speech_recognition/__init__.py", line 858, in recognize_google if not isinstance(actual_result, dict) or len(actual_result.get("alternative", [])) == 0: raise UnknownValueError() speech_recognition.UnknownValueError any idea?
Thanks! I am pretty sure this error comes when recognizer does not get any audio from the user and then it just sends static noise to Google wed speech API which does not understand that and doesn't give anything back. If this is the case then yeas after longer uses this program might bring this error. A simple solution for that would be to use Try Except conditions for reading the voice. You can simply read the certain level of voice from which it activates the comunication with recognizer. I hope this helped! And thanks for watching my video!
@@dhruvnayak1079 I'm new to Python but I think I solved it for me. I added Try Except so mine looks like this now while True: with mic as source: audio = r.listen(source) try: words = r.recognize_google(audio) print(words) if words == "stop" break except Exception: print("is anyone talking?") so now instead of the program cancelling from the error, it will print "is anyone talking?"
@okunugaoluwaloseyi-wgmusic264 i found that when you download a library from a RUclips video doesn't work, i use a website called pypi as it will tell you the raspberry pi terminal command needed to download a required library. Hope this helps
I keep getting an error it says "Traceback (most recent call last): File "/home/pi/speech test 1.py", line 18, in Words = r.recognize_google(audio)" this isn't the full error but like can you helpM
shouldnt title be 'Speech Recognition With google'. at least the v2 speech decoder module is hw and can operate without an internet connection. v3 hw module is way better than v2
Brother can we train siren and recognize using this code if not how to achieve it pls do reply its really urgent :) hope you see this comment and reply :)
Traceback (most recent call last): File "/var/www/html/vr/sp.py", line 18, in words = r.recognize_google(audio) File "/home/eva/.local/lib/python3.9/site-packages/speech_recognition/__init__.py", line 858, in recognize_google if not isinstance(actual_result, dict) or len(actual_result.get("alternative", [])) == 0: raise UnknownValueError() speech_recognition.UnknownValueError
Thank You everyone for watching this video! It took me time to make this project so I am really happy that people take interest in it! So again Thanks! And If You liked the video Leave a like or if You have any questions You can always reach me on discord!
Plz which version of linux used on ur raspberry??
Can anyone guide me which microphone brand is used should be best in noise cancelling
Hello. Thanks for taking the time to detail this! My Dad is 85yrs old, lives mostly alone and he has very bad hearing so he requires hearing aids to hear most things. But at night he does not wear them. So he cannot hear his house alarm system if there is a warning of a fire, intrusion, etc. I have set up voice-activated (VOC) intercom by his alarm station in the hall and a receiver intercom by his bed which will transmit anything the alarm and/or a remote, live alarm person says such as asking him "is everything is ok?". But again he can't really hear unless he puts his hearing aids in which takes time assuming he even knows to do this. So I have purchased a heavy-duty industrial vibrator I plan to mount to his bed frame and I plan to have the alarm speaker voltage act as a signal to a relay to turn on the vibrator if the alarm is going off. (actually, the alarm is so high-pitched he can't even hear it with his hearing aids in even when right next to it. And despite it being SO loud most people can't take more than 10 seconds or so before saying "please turn it off!") So I'd really like to have something that, after vibrating him awake would transcribe what is being said on the bed-side intercom and then project it on his bedroom wall (using a cheap $100 video projector) so he can "hear"/read what is being said by the alarm or someone on another home intercom. But this is something that would have to be on all day or at least at night without fail as I can't really rely on him to remember to turn it on, type commands to start a program, etc. each night. Do you have any thoughts on how this could be done? I should mention I am a mech engineer who has worked on Pi-related projects but I have no real hands-on experience with them. Well, thanks for reading! - Jim
Bro this was the most easiest tutorial…. Like from the scratch! Thank u so much for this!
I am realy glad it helped! And thanks for watching my video!
great video. got straight to the point of a simple thing many people are trying to do. great instructions chief.
Thank you very much :> realy glad yo hear that it helped! Makes me wanna create more stuff like that!
Thanks for the very well produced video!!
And thank You for watching it! Comments like this realy motivate me to make more videos! So thank You very much for watching it!
iam rpi 4
i cannot install python-pyaudio but i could isntall python3
the erorr i got "E: Unable to locate package python-pyaudio"
Bro use python3-pyaudio
Hi, this speech recognition seems great! Can we use the same way for offline voice assistant? For example : in a situation when your internet connection is broken down for a while... How to solve it? Thanks!
Hey, thank You for watching it! So this model is fully internet dependable, since the recognition models are in Google web speech API and this project sends info there. So to make it not internet dependable You would need to train Your own speech recognition models in the same local computer, which is I have to say kinda harder :D, again thanks for watching! And maybe I will try to make offline version in the future!
@@Audas101 yes absolutely an off line version would be outstanding Audas
Hello, I just wanna ask you that how to configure raspberry Pi with usb microphone
Thank you very much, great work!
Thank you! And thanks for watching!
hey thanks for the video its so simple , I have a question can I make voice recognition with different language ?
After a while of no speaking it shows an error, how can I keep the program working Even if I am not talking for a long period of time ?
Hey, thanks for watching! So in that case I had same problems and I haven't tried fixing them, but I thought that "try" "except" case should work, tho I am not sure.
My recognizer is taking too long to respond...what should i do to fix it?
Hey, Yes first response takes time, but after the first response it is connected to the server and then the response speed depends on Your internet speed. As I said mine was about 2 seconds for each response. I hope this helped!
@@Audas101 thanks man! I think my internet was not helping too...but now its working very well! Your tutorial is incredible and help me a lot ! Good job ! 👏
@@vitorsinventions Thank You for watching it and giving a try!
connections can you show, please how exactly u did
Great video. Just one question,
I have connected the output to my Bluetooth headsets. How can I play/ listen to what comes in via mic?
There are special commans in Raspbian for that, You can try google them. Or (as I did for myself) You can download screen capturing program in which You can record Your screen and voice and later on watch it
Very thank you
Thank you for watching!
was it must be connected to the internet to made speech recognition work?
Hey, yes it must be connected to the internet since it is not a local recognition model.
This video is fantastic, that's exactly What I was searching for! But to be honest, I would be sooo happy if you would like to do the version without recording the audio to optimize the recognition time! :D Would be great to see the video with this better version too! :D BTW. Can this programm work while "Smart mirror program" is running? :D
Hey, first of all thanks for watching! So I will try to optimize this in the future! however the part that takes the most time is communicating with server, but I will try to make a version with local voice recognition model which will definitely improve the speed! And I am not sure about the smart mirror thing, but I am pretty sure it is possible to fuse them :D Again thanks for watching!
My raspberry pi is not recording my voice i connected the mic using USB sound card all are recognised by raspberry pi but not working I have tried lots of ways like resetting the alsa mixer but it didn't work iam using raspberry pi 3 B+.... the mic and sound card are working perfectly in the pc
@krugergaming-yt8121 I also just had the same error you had, I'm using the Rpi model 3B. Did you manage to resolve the error?
can you do this on C?
Good morning ! Great video;) But how do you prevent an error from stopping the program? Thank you
Hey! Thanks for watching! To prevent errors or, to be more specific, to define the errors you could you a "try, except" command or you could absolutely stop the audio reading and sending to the web speech API.
@@Audas101 Thank you for your reply ! the try command worked! how to stop audio playback? and do you know how i can access the pygame library? I would like to remove the print of start program
Can anyone guide me which microphone brand is used should be best in noise cancelling
can this work without the usb sound card?
hi the code is amazing but i have a problem when running the code I get a error like microphone is not defined what I can do (I am using a mems microphone allocated to card 0)
Hey, thanks. Have You tried checking if You really are detecting any sound from Your mic? And also You can check via python which mic is being used, there is a simple command for that, but i can't recall it now. i Haven't had this problem in particular, so I don't know this helps or not, but try playing more with Alsamixer settings, cause that helped me a lot.
Plzzz help my chromium is not opening it just loades and doesn't open I have raspberry pi zero w with recommend os installed plzz help
Only thing that’s worked for me
Hi. How i can send the order to mqtt
HI, can this work with respeaker 2mic pi hat ?
So I don't realy know about the hat, but my method is using the USB so it instantly understands the mic. With hat mic would probably go through GPIO and i am not quite sure how raspberry reacts there. But you can check Alsa if it sees the mic. And if it does detect it then most likely everything stays the same for the code part
It works with USB mic?
I tried to enter to Discord server but the link expired
Ah sorry about the link, I updated it now so should be ok in an hour or so. And yes it works with USB mic or to be more precise it works with USB sound card, which let's You connect microphone and headphones.
which raspbeery u had used and it can work with Audio jack converter so we dont need a mic dependens on usb for raspberey
I got rpi 3 v1.2 will it work?
I want to ask a question
Can I just buy a cheap plastic sound card and can use my regular earphones (usual earphones) mic just by entering the earphone's jack in the sound card mic input?
and if I don't need other things just speech recognition and prints what I said then do I need anything else alongside with the soundcard?
please answer really need to know
Sir how to connect mic speaker with raspberry pi 3 model b
Hey! You connect it through a USB audio card.
Cant find python-pyaudio package
great work man ......sometime I get error like this .....
raceback (most recent call last):
File "/home/pi/voice recg.py", line 18, in
words = r.recognize_google(audio)
File "/usr/local/lib/python3.7/dist-packages/speech_recognition/__init__.py", line 858, in recognize_google
if not isinstance(actual_result, dict) or len(actual_result.get("alternative", [])) == 0: raise UnknownValueError()
speech_recognition.UnknownValueError
any idea?
Thanks! I am pretty sure this error comes when recognizer does not get any audio from the user and then it just sends static noise to Google wed speech API which does not understand that and doesn't give anything back. If this is the case then yeas after longer uses this program might bring this error. A simple solution for that would be to use Try Except conditions for reading the voice. You can simply read the certain level of voice from which it activates the comunication with recognizer. I hope this helped! And thanks for watching my video!
Thank you.
@@dhruvnayak1079 I'm having the same problem, were you able to fix it? and if so, what did you do?
@@benhardy8351 i havent yet ..i will update if i find a solution
@@dhruvnayak1079 I'm new to Python but I think I solved it for me. I added Try Except so mine looks like this now
while True:
with mic as source:
audio = r.listen(source)
try:
words = r.recognize_google(audio)
print(words)
if words == "stop"
break
except Exception:
print("is anyone talking?")
so now instead of the program cancelling from the error, it will print "is anyone talking?"
Hey, i have an issue where for sudo apt-get install python-pyaudio python3-pyaudio, it says it cant find a package called python-audio, any ideas?
same
@okunugaoluwaloseyi-wgmusic264 i cant remember how i sorted it. I think i just reset the pi or did pip install pyaudio
@okunugaoluwaloseyi-wgmusic264 i found that when you download a library from a RUclips video doesn't work, i use a website called pypi as it will tell you the raspberry pi terminal command needed to download a required library. Hope this helps
iI get this error, help :c
OSError: No Default Input Device Available
I keep getting an error it says "Traceback (most recent call last):
File "/home/pi/speech test 1.py", line 18, in
Words = r.recognize_google(audio)" this isn't the full error but like can you helpM
Hey, does this happen after some time using the recognition or before even recognizing something?
@@Audas101 After ssome time using it
i think the coumputer will write
i can hear you let me talk with your leader
No module named "speech_recognition"
I installed speech recognition but it won't run due to it "not being recognized"
@@stinger220try: sudo pip install SpeechRecognition or sudo pip3 install SpeechRecognition
shouldnt title be 'Speech Recognition With google'. at least the v2 speech decoder module is hw and can operate without an internet connection. v3 hw module is way better than v2
error: import speech_recognition as sr
Congratulations you just made a google spy device
Google please give me job :D
Let me know which os you was used in this video
Brother can we train siren and recognize using this code if not how to achieve it pls do reply its really urgent :) hope you see this comment and reply :)
Traceback (most recent call last):
File "/var/www/html/vr/sp.py", line 18, in
words = r.recognize_google(audio)
File "/home/eva/.local/lib/python3.9/site-packages/speech_recognition/__init__.py", line 858, in recognize_google
if not isinstance(actual_result, dict) or len(actual_result.get("alternative", [])) == 0: raise UnknownValueError()
speech_recognition.UnknownValueError