用于构建支持语音的应用程序的语音引擎
voice_engine的Python项目详细描述
语音引擎
该库用于创建语音接口应用程序。 它包括构建块,如KWS(关键字定位)、DOA(到达方向)还有一些元素可以测量rms(dbfs或db(a))。
要求
- pyaudio
- 努比
- 雪童
安装
安装pyaudio、numpy和snowboy,使用virtualenv虚拟python环境
sudo apt install python-pyaudio python-numpy python-virtualenv
sudo apt-get install swig python-dev libatlas-base-dev build-essential make
git clone --depth 1 https://github.com/Kitt-AI/snowboy.git
cd snowboy
virtualenv --system-site-packages env
source env/bin/activate
python setup.py build
python setup.py bdist_wheel
pip install dist/snowboy*.whl
cd ..
git clone https://github.com/voice-engine/voice-engine.git
cd voice-engine
python setup.py bdist_wheel
pip install dist/*.whl
开始
要录制音频并搜索关键字“snowboy”,请参见^{
importtimefromvoice_engine.kwsimportKWSfromvoice_engine.sourceimportSourcesrc=Source()kws=KWS()src.link(kws)defon_detected(keyword):print('found {}'.format(keyword))kws.on_detected=on_detectedkws.start()src.start()whileTrue:try:time.sleep(1)exceptKeyboardInterrupt:breakkws.stop()src.stop()
积木
库使用gstreamer类的elements,可以作为音频管道链接在一起。 一个元素可以连接到多个其他元素
拓扑结构可以是:
Source --> ChannelPicker --> KWS Source --> ChannelPicker --> KWS --> Alexa
| /\
V / \
DOA Alexa Google Asissitant