speech_recognition | Speech recognition module for Python | Speech library

 by   Uberi Python Version: 3.10.0 License: BSD-3-Clause

kandi X-RAY | speech_recognition Summary

kandi X-RAY | speech_recognition Summary

speech_recognition is a Python library typically used in Artificial Intelligence, Speech applications. speech_recognition has no bugs, it has no vulnerabilities, it has build file available, it has a Permissive License and it has medium support. You can download it from GitHub.

Speech recognition module for Python, supporting several engines and APIs, online and offline.

            kandi-support Support

              speech_recognition has a medium active ecosystem.
              It has 7239 star(s) with 2264 fork(s). There are 285 watchers for this library.
              There were 1 major release(s) in the last 12 months.
              There are 262 open issues and 305 have been closed. On average issues are closed in 240 days. There are 33 open pull requests and 0 closed requests.
              It has a neutral sentiment in the developer community.
              The latest version of speech_recognition is 3.10.0

            kandi-Quality Quality

              speech_recognition has no bugs reported.

            kandi-Security Security

              speech_recognition has no vulnerabilities reported, and its dependent libraries have no vulnerabilities reported.

            kandi-License License

              speech_recognition is licensed under the BSD-3-Clause License. This license is Permissive.
              Permissive licenses have the least restrictions, and you can use them in most projects.

            kandi-Reuse Reuse

              speech_recognition releases are available to install and integrate.
              Build file is available. You can build the component from source.

            Top functions reviewed by kandi - BETA

            kandi's functional review helps you automatically verify the functionalities of the libraries and avoid rework.
            Currently covering the most popular Java, JavaScript and Python libraries. See a Sample of speech_recognition
            Get all kandi verified functions for this library.

            speech_recognition Key Features

            No Key Features are available at this moment for speech_recognition.

            speech_recognition Examples and Code Snippets

            Pythondot img1Lines of Code : 67dot img1License : Permissive (MIT)
            copy iconCopy
            class TextTransform:
                """Maps characters to integers and vice versa"""
                def __init__(self):
                    char_map_str = """
                    ' 0
                    a 2
                    b 3
                    c 4
                    d 5
                    e 6
                    f 7
                    g 8
                    h 9
            Pythondot img2Lines of Code : 10dot img2License : Permissive (MIT)
            copy iconCopy
            "n_cnn_layers": 3
            "n_rnn_layers": 7
            "rnn_dim": 1024
            "n_class": 29
            "n_feats": 128
            "stride": 2
            "dropout": 0.1
            learning_rate =  5e-4
            batch_size = 20
            epochs = 100
            Automatic speech recognition framework for python
            Pythondot img3Lines of Code : 26dot img3License : Strong Copyleft (CC BY-SA 4.0)
            copy iconCopy
            import speech_recognition as sr 
            import pyttsx3  
            r = sr.Recognizer()  
            def SpeakText(command): 
                engine = pyttsx3.init() 
                    with sr.Microphone() as sou

            Community Discussions


            Speech Recognition(IBM) username and password
            Asked 2022-Apr-11 at 08:50

            I hope to use IBM speech recognition service without - curl or ibm_watson module.
            And my attempt is below:



            Answered 2022-Apr-11 at 08:50

            Here are the official API docs for Speech to Text: https://cloud.ibm.com/apidocs/speech-to-text

            It includes various samples and further links. You can use the IAMAuthenticator to turn an API key into an authentication token and to handle refresh tokens. If you don't want to make use of the SDK you have to deal with the IBM Cloud IAM Identity Service API on your own. The API has functions to obtain authentication / access tokens.

            I often use a function like this to turn an API key into an access token:

            Source https://stackoverflow.com/questions/71821208


            Google speech recognition not recognizing certain words / phrases like um and er | python
            Asked 2022-Apr-01 at 02:56

            So it seems google speech recognition is taking out certain parts of my speech like um, er and ahh. The problem is I want these to be recognized, I can not seem to figure out how to enable this.

            Here is the code:



            Answered 2022-Apr-01 at 02:56

            I took a look at the Google Cloud Speech-to-text API docs and didn't see anything relevant (as of March 2022). I also came across these related resources:

            All evidence suggests that it isn't possible to use the Google Cloud Speech-to-text service (at this time), and that you'll have to seek alternative services. I won't rehash the alternatives listed in the resources, but several are provided and you'll have to pick which one best suits your particular needs.

            Also, you may already know this (so apologies if you do), but these types of words are typically called "filler" and/or "hesitation" words. That might be helpful to you while researching the topic.

            The good news is that the SpeechRecognition module (I think that's what you're using based on your code) supports several different engines, so hopefully one of those provides filler words.

            Source https://stackoverflow.com/questions/71682150


            Find A value in list , if there are multiple value print all the values else print the corresponding values from another list
            Asked 2022-Mar-18 at 12:09

            I have two lists :



            Answered 2022-Mar-18 at 12:09
            Keyword = ['Dog', 'Cat', 'White Cat', 'Lion', 'Black Cat']
            Definition = ['Mans Best Friend', 'The cat is a domestic species of a small carnivorous mammal', 'White  cats are cute', 'Lions are Carnivores Wild Animal', 'Black Cats are Black in color']
            def take_cmd(cmd):
                if cmd in Keyword:
                    for i,j in enumerate(Keyword):
                        if cmd in j:
                    if len(multiple_val)>1:
                        i_removed=[j for i in multiple_val for j in i if type(j)!=int]
                        print(f"We have found multiple keywords : {i_removed}")
                    print("There are no Matching Keywords")

            Source https://stackoverflow.com/questions/71522230


            Wikipedia Library shows error if input not given exactly to the name of a page of wikipedia
            Asked 2022-Mar-12 at 13:51

            If I give a voice command using speech recognition module to search something in Wikipedia if I don't say exactly it shows an error. For example: I say(National Defence Academy) no Wikipedia page is named so but(National Defence Academy (India)) is a page, so it shows results. I want to search for the nearest page as per my voice command. Here is my code:



            Answered 2022-Mar-12 at 13:51

            A similar search has to be made in this case. You are using the Wikipedia package and not Pywikibot as tagged above. Anyway here is a code snippet how a similar search can be done with Pywikibot:

            Source https://stackoverflow.com/questions/71369216


            Error when creating jarvis ai, object is not callable, etc
            Asked 2022-Mar-10 at 05:33

            Error Code 👈This is the picture This is the code for my ai👇



            Answered 2022-Mar-10 at 05:33

            replace your takeCommand() function with this:

            Source https://stackoverflow.com/questions/71389304


            Build a voice assistant to open the application with a path in the curly bracket
            Asked 2022-Mar-06 at 15:39

            I wondered if I could add a lot of paths to open the application, but my code only opens the calculator when I ask to open chrome. It shows me like this The file /System/Applications/Google Chrome.app does not exist. Suppose you want to fix my code to be better. I am on a mac, by the way. Thank you.

            my code:



            Answered 2022-Mar-06 at 15:39

            Try specifying the Chrome Path as:

            Source https://stackoverflow.com/questions/71371642


            How to open wa.me link directly on Whastapp desktop application, rather than it redirecting to web (on PC)?
            Asked 2022-Mar-02 at 14:32

            I am writing a Python script (3.10.2) which opens certain desktop applications via voice command using the pyttsx3 and speech_recognition modules.

            I thought of including Whatsapp into this script as well, and provided the wa.me chat link of one of my whatsapp contacts, which would open after a certain voice command is said.

            However, the problem lies when it opens the link, instead of directly opening it on the Whatsapp desktop application (already downloaded from MSStore) it redirects itself to the web and then the prompt asks if to continue on web or to open the desktop application.

            I want to make it, directly opening the application, rather than going through the web prompts. Is there a way?

            Thanks in advance!



            Answered 2022-Mar-02 at 14:32

            Ok, here. There are two ways one is this:

            Source https://stackoverflow.com/questions/71320853


            IndexError: tuple index out of range when I try to create an executable from a python script using auto-py-to-exe
            Asked 2022-Feb-24 at 15:03

            I have been trying out an open-sourced personal AI assistant script. The script works fine but I want to create an executable so that I can gift the executable to one of my friends. However, when I try to create the executable using the auto-py-to-exe, it states the below error:



            Answered 2021-Nov-05 at 02:20
            42681 INFO: PyInstaller: 4.6
            42690 INFO: Python: 3.10.0

            Source https://stackoverflow.com/questions/69776492


            No Audio with pyttsx3 Library in Python 3 (No errors)
            Asked 2022-Feb-23 at 19:25

            Using pyttsx3 (tried versions 2.5 to current) on Visual Studios Code on Windows 10 With Python 3.10.0. My Problem that I am currently having is that the code will run through, but no audio is being outputted. while debugging there is no pause stepping into or over the code (for parts including pyttsx3). I made sure my audio is on, and that it is working. I used a different tts library gtts and the audio worked, but I am trying to write offline. I also tried this exact code from VS code in PyCharm and I still had the same problem. Again with no errors or warnings.



            Answered 2022-Feb-23 at 19:25

            You forgot to put the parentheses on engine.runAndWait. Do this: engine.runAndWait()

            Source https://stackoverflow.com/questions/71230103


            How to close all the processes one by one in a program that operates with multiprocessing by means of an 'if' validation found in one of them process?
            Asked 2022-Feb-12 at 20:25
            import multiprocessing
            from threading import Thread
            import speech_recognition as sr
            def actions_func(conn1_3,conn2_3):
            def capture_cam(conn1, conn1b):
            def audio_listening(conn2, conn2b):
                global catch_current_frame
                catch_current_frame = False
                # start dameon thread to handle frame requests:
                Thread(target=handle_catch_current_frame_requests, args=(conn2,), daemon=True).start()
                Thread(target=handle_cam_activate_requests, args=(conn2b,), daemon=True).start()
                while True:
                    r = sr.Recognizer()
                    with sr.Microphone() as source:
                        catch_current_frame = False
                        print("Please say something...")
                        audio = r.listen(source)
                            text = r.recognize_google(audio, language="es-ES")
                            print("You have said: \n " + repr(text))
                            if text.lower() == "capture":
                                catch_current_frame = True
                            elif text.lower() == "Close your program":
                                #This is where I need to close processes p1, p2 and p3
                        except Exception as e:
                            print("Error : " + str(e))
            def main_process(finish_state):
                conn1, conn1_3 = multiprocessing.Pipe(duplex=True)
                conn2, conn2_3 = multiprocessing.Pipe(duplex=True)
                conn1b, conn2b = multiprocessing.Pipe(duplex=True)
                #Process 1
                p1 = multiprocessing.Process(target=capture_cam, args=(conn1, conn1b, ))
                #Process 2
                p2 = multiprocessing.Process(target=audio_listening, args=(conn2, conn2b, ))
                #Process 3
                p3 = multiprocessing.Process(target=actions_func, args=(conn1_3 ,conn2_3 ,))
            if __name__ == '__main__':
                finish_state = multiprocessing.Event()
            print("continue the code... ")


            Answered 2022-Feb-12 at 20:25

            You could try the following Event-based solution (but there are even simpler solutions to follow):

            Have main_process pass to audio_listening an additional argument, finish_state:

            Source https://stackoverflow.com/questions/71094978

            Community Discussions, Code Snippets contain sources that include Stack Exchange Network


            No vulnerabilities reported

            Install speech_recognition

            You can download it from GitHub.
            You can use speech_recognition like any standard Python library. You will need to make sure that you have a development environment consisting of a Python distribution including header files, a compiler, pip, and git installed. Make sure that your pip, setuptools, and wheel are up to date. When using pip it is generally recommended to install packages in a virtual environment to avoid changes to the system.


            For any new features, suggestions and bugs create an issue on GitHub. If you have any questions check and ask questions on community page Stack Overflow .
            Find more information at:

            Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items

            Find more libraries
          • HTTPS


          • CLI

            gh repo clone Uberi/speech_recognition

          • sshUrl


          • Stay Updated

            Subscribe to our newsletter for trending solutions and developer bootcamps

            Agree to Sign up and Terms & Conditions

            Share this Page

            share link