pocketsphinx

pocketsphinx - how to switch from keyword spotting to grammar mode

回眸只為那壹抹淺笑 提交于 2021-02-07 09:01:02
问题 I'm using pocketsphinx with raspberry pi for home automation. I've written a simple JSGF grammar file with the supported commands. Now, I want to use an activation phrase such as "hey computer" prior to the commands, to avoid false detections and only perform speech recognition once the activation phrase has been spoken. If I'm not getting this wrong, pocketsphinx supports two modes for speech recognition: keyword spotting mode, and language model / JSGF grammar mode. In pocketsphinx FAQ when

使用SpeechRecognition进行语音识别

大城市里の小女人 提交于 2020-10-02 08:29:09
操作系统 : CentOS7.7.1908_x64 gcc版本 :4.8.5 Python 版本 : 3.6.8 安装语音识别环境: virtualenv -p /usr/bin/ python3 py36asr source py36asr /bin/ activate pip install SpeechRecognition yum install python3- devel yum install pulseaudio-libs- devel yum install alsa-lib- devel pip install PocketSphinx 配置中文语音识别数据: 下载地址: https://sourceforge.net/projects/cmusphinx/files/Acoustic%20and%20Language%20Models/ 选择: Mandarin->cmusphinx-zh-cn-5.2.tar.gz 配置数据: cd py36asr/lib/python3. 6 /site-packages/speech_recognition/pocketsphinx-data/ tar zxvf cmusphinx-zh-cn- 5.2 . tar .gz mv cmusphinx-zh-cn- 5.2 zh- cn cd zh - cn mv zh

Python Pocketsphinx: Keyword not being recognised from a .wav file

南楼画角 提交于 2020-07-22 06:12:02
问题 I'm trying to detect the keyword temperature from a recording of me only saying the phase temperature (there are no other words present). Originally I used the keyword hello and it worked fine but whenever I try with any other word it does not. My current code is as follows: import pocketsphinx as ps import requests import json import sys, os model_path = ps.get_model_path() data_path = ps.get_data_path() # Call to API def get_temperature(): headers = { 'accept': 'application/json', 'x-api

Python Pocketsphinx: Keyword isn't recognised when using Decoder class

纵饮孤独 提交于 2020-07-10 03:14:54
问题 I'm trying to detect a keyword from a .wav file using Pocketsphinx, specifically with the decoder class. When I give it this .wav file and print what it detects it isnt even close. Here is the code: import pocketsphinx as ps import requests import json import sys, os import subprocess model_path = ps.get_model_path() data_path = ps.get_data_path() print("start") print(os.getcwd()) subprocess.call("sox -V4 /home/miro/client_audio.wav -r 16000 -c 1 client_audio.wav", shell=True) config = ps

Python Pocketsphinx: Keyword isn't recognised when using Decoder class

半世苍凉 提交于 2020-07-10 03:11:10
问题 I'm trying to detect a keyword from a .wav file using Pocketsphinx, specifically with the decoder class. When I give it this .wav file and print what it detects it isnt even close. Here is the code: import pocketsphinx as ps import requests import json import sys, os import subprocess model_path = ps.get_model_path() data_path = ps.get_data_path() print("start") print(os.getcwd()) subprocess.call("sox -V4 /home/miro/client_audio.wav -r 16000 -c 1 client_audio.wav", shell=True) config = ps

Running different commands with different words in PocketSphinx

不问归期 提交于 2020-01-17 03:25:19
问题 I have found ways to make pocketsphinx activate using multiple keywords, but I want to run diffrent commands depending on which keyword was said. I have already made it connect to Amazon's Alexa server when "Alexa" is said and now I want to add a command when I say "TV Off" and "TV On." 回答1: The best thing is to use python, something like this: import sys, os from pocketsphinx.pocketsphinx import * from sphinxbase.sphinxbase import * import pyaudio modeldir = "../../../model" # Create a

Handling Errors in PocketSphinx Android app

限于喜欢 提交于 2020-01-14 04:16:27
问题 I am using the default dictionary that comes with the pocketsphinx demo which is good for my purposes. When a user enters a phrase, the app starts a keyphrase listening but if the word is not found in the dictionary the app crashes. The app crashes onError() within a service. How is the error handling done? is there any way I can catch the error? Overall I would just like the service to call stopSelf() when an error happens so the main activity won't crash as well. Errors: ERROR: "kws_search

Installing pocketsphinx python module: command 'swig.exe' failed

时光怂恿深爱的人放手 提交于 2020-01-11 05:01:09
问题 I'm getting something like this. Can anyone please tell me how to fix this. C:\Users\krush\Documents\ML using Python>pip install pocketsphinx Collecting pocketsphinx Using cached pocketsphinx-0.1.3.zip Building wheels for collected packages: pocketsphinx Running setup.py bdist_wheel for pocketsphinx: started Running setup.py bdist_wheel for pocketsphinx: finished with status 'error' Complete output from command C:\Users\krush\Anaconda3\python.exe -u -c "import setuptools, tokenize;__file__='C

Pocketsphinx install fail? Raspberry Pi Zero (Raspbian Jessie)

一个人想着一个人 提交于 2020-01-01 07:50:32
问题 This will probably get tagged as a duplicate, but I haven't had any luck, so here we go. I'm trying to develop a "Jarvis" like setup with Python2.7. I', looking to use Pocketsphinx as part of that. I tried to do this on my Windows 10 machine, but Pocketsphinx requires Swig, and that utterly failed on the Windows 10 machine (I'm still working on that.) So, I moved over to my Raspberry Pi Zero, since that is where I will be looking to impliment the actual program anyways. I got Swig to install

Python pocketsphinx RequestError: missing PocketSphinx module: ensure that PocketSphinx is set up correctly

故事扮演 提交于 2019-12-29 04:45:25
问题 I am trying to make a Python app that can record audio and translate it into english text using PyAudio, SpeechRecognition and PocketSphinx. I'm running on a Mac OS X El Capitan, version 10.11.2. Following a tutorial like this one and others, I've downloaded PyAudio version 0.2.9, SpeechRecognition as well as PocketSphinx. I've installed them into a Conda environment. I have followed the instructions from this site to use brew install swig git python on my OS X, hoping it would help. This is