list_microphone_names ()): print ( "Microphone with name \" )`". To figure out what the value of MICROPHONE_INDEX should be, run the following code: import speech_recognition as sr for index, name in enumerate ( sr. Once you do this, change all instances of Microphone() to Microphone(device_index=MICROPHONE_INDEX), where MICROPHONE_INDEX is the hardware-specific index of the microphone. If you happen to be using a Raspberry Pi, you’ll need a USB sound card (or USB microphone). This causes the default microphone used by PyAudio to simply block when we try to read it. This usually happens when you’re using a Raspberry Pi board, which doesn’t have audio input capabilities by itself. The recognizer hangs on recognizer_instance.listen specifically, when it’s calling. This document is also included under reference/pocketsphinx.rst. See Notes on using PocketSphinx for information about installing languages, compiling PocketSphinx, and building language packs from online resources. Using the bundled wheel packages or building from source is recommended. Note that the versions available in most package repositories are outdated and will not work with the bundled language data. On Linux and other POSIX systems (such as OS X), follow the instructions under “Building PocketSphinx-Python from source” in Notes on using PocketSphinx for installation instructions. third-party/WHEEL_FILENAME (replace pip with pip3 if using Python 3) in the SpeechRecognition folder. To install, simply run pip install wheel followed by pip install. PocketSphinx-Python wheel packages for 64-bit Python 2.7, 3.4, and 3.5 on Windows are included for convenience, under the third-party/ directory. PocketSphinx-Python is required if and only if you want to use the Sphinx recognizer ( recognizer_instance.recognize_sphinx). third-party/WHEEL_FILENAME (replace pip with pip3 if using Python 3) in the repository root directory. PyAudio wheel packages for common 64-bit Python versions on Windows and Linux are included for convenience, under the third-party/ directory in the repository root. On other POSIX-based systems, install the portaudio19-dev and python-all-dev (or python3-all-dev if using Python 3) packages (or their closest equivalents) using a package manager of your choice, and then install PyAudio using Pip: pip install pyaudio (replace pip with pip3 if using Python 3).Then, install PyAudio using Pip: pip install pyaudio. On OS X, install PortAudio using Homebrew: brew install portaudio.If the version in the repositories is too old, install the latest release using Pip: execute sudo apt-get install portaudio19-dev python-all-dev python3-all-dev
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |