How to install PocketSphinx under Linux

WBOY
Release: 2023-05-16 21:43:51
forward
1629 people have browsed it

Select python’s speech package

There are some ready-made speech recognition packages in PyPI. These include:
apiai
google-cloud-speech
pocketsphinx
SpeechRcognition
watson-developer-cloud
wit
Some software packages (such as wit and apiai) provide some Built-in capabilities beyond basic speech recognition, such as natural language processing to identify speaker intent. Other software packages, such as Google Cloud Speech, focus on speech-to-text conversion.
Among them, SpeechRecognition stands out for its ease of use.
Recognizing speech requires audio input, and retrieving audio input in SpeechRecognition is very simple. It does not require building a script to access the microphone and process the audio file from scratch. It only takes a few minutes to automatically complete the retrieval and run.
But there was a connection timeout problem when installing the relevant voice package through the command: pip3 install SpeechRecognition.

Recognizer class

The core of SpeechRecognition is the recognizer class.
The main purpose of the Recognizer API is to recognize speech. Each API has a variety of settings and functions to recognize the speech of the audio source, namely:
recognize_bing(): Microsoft Bing Speech
recognize_google(): Google Web Speech API
recognize_google_cloud(): Google Cloud Speech - requires installation of the google-cloud-speech package
recognize_houndify(): Houndify by SoundHound
recognize_ibm(): IBM Speech to Text
recognize_sphinx() : CMU Sphinx - requires installingPocketSphinx
recognize_wit(): Wit.ai
Of the above seven, only recognition_sphinx() can work offline with the CMU Sphinx engine, the other six need to be connected to the Internet.
So I chose to use recognition_sphinx() for speech recognition.
When using pip3 install PocketSphinx to download related libraries, the following problems occurred:

How to install PocketSphinx under Linux

I checked a lot of information, but the installation still failed! ! !
You should use sudo apt install python-pocketsphinx before using pip3 install PocketSphinx. Then use pip3 install -i https://pypi.tuna.tsinghua.edu.cn/simple PocketSphinxThis command should install successfully. If it still fails, you can use the command sudo apt-get install python python-all-dev python-pip build-essential swig git libpulse-dev libasound2-dev. Generally this problem occurs due to lack of relevant dependencies!

How to install PocketSphinx under Linux

The above is the detailed content of How to install PocketSphinx under Linux. For more information, please follow other related articles on the PHP Chinese website!

Related labels:
source:yisu.com
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!