Speech Recognition With Raspberry Pi

Поделиться
HTML-код
  • Опубликовано: 20 апр 2021
  • This is a tutorial on how to make Your own speech recognition on raspberry pi. So enjoy!
    You will need:
    Raspberry Pi 3 B+ or better
    USB sound card
    SD card with NOOBS
    Any working microphone
    Red LED
    150 ohm, 0,25 W resistor
    Logic 2 relay module
    and basic stuff for a computer to work
    GitHub: github.com/AudasWasTaken/Voic...
    If You wanna help me create more content chack out my Patreon: www.patreon.com/user?u=75474450
    If something is not clear You can always reach me on discord: / discord
    Catch me on twitter: / audas30821741
    Music:
    Jaokim Karud - Canals
    / - topic
    Patrick Patrikios - Select
    Fluffing a Duck by Kevin MacLeod is licensed under a Creative Commons Attribution 4.0 license. creativecommons.org/licenses/...
    Source: incompetech.com/music/royalty-...
    Artist: incompetech.com/
  • НаукаНаука

Комментарии • 79

  • @Audas101
    @Audas101  3 года назад +7

    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!

    • @NobodyKnow10
      @NobodyKnow10 2 года назад

      Plz which version of linux used on ur raspberry??

  • @JamesDTaylorSTL
    @JamesDTaylorSTL 2 года назад +8

    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

  • @chiraagarunkumar5691
    @chiraagarunkumar5691 2 года назад +4

    Bro this was the most easiest tutorial…. Like from the scratch! Thank u so much for this!

    • @Audas101
      @Audas101  2 года назад

      I am realy glad it helped! And thanks for watching my video!

  • @Steven-jf4cs
    @Steven-jf4cs 2 года назад +1

    Thanks for the very well produced video!!

    • @Audas101
      @Audas101  2 года назад

      And thank You for watching it! Comments like this realy motivate me to make more videos! So thank You very much for watching it!

  • @kevery.
    @kevery. 2 года назад +1

    great video. got straight to the point of a simple thing many people are trying to do. great instructions chief.

    • @Audas101
      @Audas101  2 года назад

      Thank you very much :> realy glad yo hear that it helped! Makes me wanna create more stuff like that!

  • @n1vca
    @n1vca Год назад +1

    Thank you very much, great work!

    • @Audas101
      @Audas101  Год назад

      Thank you! And thanks for watching!

  • @wojciechjurga2440
    @wojciechjurga2440 2 года назад +1

    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

    • @Audas101
      @Audas101  2 года назад

      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!

  • @thebigone1273
    @thebigone1273 2 года назад +1

    Very thank you

    • @Audas101
      @Audas101  Год назад

      Thank you for watching!

  • @ashrafelshahawy8561
    @ashrafelshahawy8561 2 года назад +1

    hey thanks for the video its so simple , I have a question can I make voice recognition with different language ?

  • @adil.9064
    @adil.9064 Год назад +1

    Only thing that’s worked for me

  • @DnKZone
    @DnKZone 2 года назад

    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

  • @zainabkaid593
    @zainabkaid593 2 года назад

    which raspbeery u had used and it can work with Audio jack converter so we dont need a mic dependens on usb for raspberey

  • @OLebongiler
    @OLebongiler 2 года назад +3

    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!

    • @Audas101
      @Audas101  2 года назад +4

      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!

    • @KnightRiderGuy
      @KnightRiderGuy 2 года назад +1

      @@Audas101 yes absolutely an off line version would be outstanding Audas

  • @deepakpks2761
    @deepakpks2761 3 года назад +1

    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)

    • @Audas101
      @Audas101  3 года назад

      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.

  • @khisrowseadeqi8416
    @khisrowseadeqi8416 Год назад

    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?

    • @Audas101
      @Audas101  Год назад

      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

  • @techburied
    @techburied 2 года назад

    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

  • @snehjain5607
    @snehjain5607 2 года назад +1

    Hello, I just wanna ask you that how to configure raspberry Pi with usb microphone

  • @harshavardhan-cf3vm
    @harshavardhan-cf3vm 2 года назад

    connections can you show, please how exactly u did

  • @krugergaming-yt8121
    @krugergaming-yt8121 9 месяцев назад

    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

  • @ahmedkimo4118
    @ahmedkimo4118 2 года назад +2

    iam rpi 4
    i cannot install python-pyaudio but i could isntall python3
    the erorr i got "E: Unable to locate package python-pyaudio"

  • @paulfrarier9586
    @paulfrarier9586 2 года назад +1

    Good morning ! Great video;) But how do you prevent an error from stopping the program? Thank you

    • @Audas101
      @Audas101  2 года назад +2

      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.

    • @paulfrarier9586
      @paulfrarier9586 2 года назад

      @@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

  • @despinaferdinandou3147
    @despinaferdinandou3147 5 месяцев назад

    can this work without the usb sound card?

  • @danfalero9300
    @danfalero9300 3 года назад +1

    It works with USB mic?
    I tried to enter to Discord server but the link expired

    • @Audas101
      @Audas101  3 года назад

      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.

  • @elrichitl2458
    @elrichitl2458 Год назад +1

    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 ?

    • @Audas101
      @Audas101  Год назад

      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.

  • @GlenCheng
    @GlenCheng 2 года назад

    can you do this on C?

  • @ardianp.atmaja872
    @ardianp.atmaja872 2 года назад +1

    was it must be connected to the internet to made speech recognition work?

    • @Audas101
      @Audas101  2 года назад

      Hey, yes it must be connected to the internet since it is not a local recognition model.

  • @MrJonath4n47
    @MrJonath4n47 2 года назад

    Hi. How i can send the order to mqtt

  • @jackraven8711
    @jackraven8711 2 года назад

    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?

    • @okunugaoluwaloseyi-wgmusic264
      @okunugaoluwaloseyi-wgmusic264 Год назад

      same

    • @jackraven8711
      @jackraven8711 Год назад

      @okunugaoluwaloseyi-wgmusic264 i cant remember how i sorted it. I think i just reset the pi or did pip install pyaudio

    • @jackraven8711
      @jackraven8711 Год назад

      @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

  • @lwt0913
    @lwt0913 2 года назад +1

    HI, can this work with respeaker 2mic pi hat ?

    • @Audas101
      @Audas101  2 года назад

      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

  • @chithraniathapaththu5655
    @chithraniathapaththu5655 5 дней назад

    I got rpi 3 v1.2 will it work?

  • @rafaelmongezavala1380
    @rafaelmongezavala1380 2 года назад

    iI get this error, help :c
    OSError: No Default Input Device Available

  • @GamingPro-bs6di
    @GamingPro-bs6di 2 года назад

    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

    • @Audas101
      @Audas101  2 года назад +1

      Hey, does this happen after some time using the recognition or before even recognizing something?

    • @squidfx9644
      @squidfx9644 Год назад

      @@Audas101 After ssome time using it

  • @claudioguendelman
    @claudioguendelman Год назад

    Cant find python-pyaudio package

  • @vitorsinventions
    @vitorsinventions 3 года назад +1

    My recognizer is taking too long to respond...what should i do to fix it?

    • @Audas101
      @Audas101  3 года назад

      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!

    • @vitorsinventions
      @vitorsinventions 3 года назад

      @@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 ! 👏

    • @Audas101
      @Audas101  3 года назад

      @@vitorsinventions Thank You for watching it and giving a try!

  • @abhishekathani17
    @abhishekathani17 2 года назад

    error: import speech_recognition as sr

  • @hayafatima9844
    @hayafatima9844 Год назад

    Sir how to connect mic speaker with raspberry pi 3 model b

    • @Audas101
      @Audas101  Год назад

      Hey! You connect it through a USB audio card.

  • @lezbriddon
    @lezbriddon 2 года назад +1

    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

  • @dhruvnayak1079
    @dhruvnayak1079 3 года назад +1

    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?

    • @Audas101
      @Audas101  3 года назад +1

      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
      @dhruvnayak1079 3 года назад +1

      Thank you.

    • @benhardy8351
      @benhardy8351 3 года назад +1

      @@dhruvnayak1079 I'm having the same problem, were you able to fix it? and if so, what did you do?

    • @dhruvnayak1079
      @dhruvnayak1079 3 года назад

      @@benhardy8351 i havent yet ..i will update if i find a solution

    • @benhardy8351
      @benhardy8351 3 года назад +2

      @@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?"

  • @sapito169
    @sapito169 2 года назад

    i think the coumputer will write
    i can hear you let me talk with your leader

  • @bobafett8732
    @bobafett8732 2 года назад

    Congratulations you just made a google spy device

    • @Audas101
      @Audas101  Год назад

      Google please give me job :D

  • @venkateshperumala388
    @venkateshperumala388 2 месяца назад

    Let me know which os you was used in this video

  • @stinger220
    @stinger220 2 года назад +1

    No module named "speech_recognition"

    • @stinger220
      @stinger220 2 года назад

      I installed speech recognition but it won't run due to it "not being recognized"

    • @kalosha_lx1548
      @kalosha_lx1548 2 года назад

      @@stinger220try: sudo pip install SpeechRecognition or sudo pip3 install SpeechRecognition

  • @abhiramsp9972
    @abhiramsp9972 5 месяцев назад

    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 :)

  • @claudioguendelman
    @claudioguendelman Год назад

    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