xiongyihui / notes

Notes
https://xiongyihui.github.io/notes/
3 stars 0 forks source link

DIY智能音箱系列 #14

Open xiongyihui opened 6 years ago

xiongyihui commented 6 years ago

想写一些关于DIY智能音箱的东西,大概的列表是这样

  1. 快速DIY一个智能音箱,基于树莓派、AVS和DuerOS
  2. 对比Amazon AVS和Google Assistant
  3. 把NLU放在本地处理,基于MyCroft的Voice Assistant
  4. 可打断的语音交互,运用回声消除AEC
  5. 声源定位,为消除方向性噪声打基础
  6. 最简单的Beamforming算法 Delay Sum
  7. 选择喇叭,测试喇叭性能

快速DIY一个智能音箱

1. 选择硬件

需要的硬件包括麦克风、喇叭、主控等,最佳的主控毫无疑问是Raspberry Pi。Raspberry Pi板载的3.5mm Audio输出的声音音质很差,建议用另外的音频输出吧。。麦克风有很多选择,包括USB麦克风(比如便宜二手的Sony PlayStation Eye),树莓派pi hat类型的麦克风。这里推荐ReSpeaker系列Pi hat,因为是我们设计的 因为很好用呀。

2. 配置树莓派

2.1 下载树莓派镜像,烧写SD卡

raspberrypi.org 下载 raspbian with desktop镜像,然后可以用 etcher 烧写 SD 卡。如果你没有额外的键盘和显示器,不要急着用 SD 卡启动,可以修改烧好的 SD 卡,配置 WiFi 网络并启用 SSH。

2.2 配置 WiFi 和 SSH

在 SD 卡的 boot 分区根目录添加文件名为 ssh 和 wpa_supplicant.conf 的两个文件。其中 wpa_supplicant.conf 的内容为:

country=GB
ctrl_interface=DIR=/var/run/wpa_supplicant GROUP=netdev
update_config=1
network={
        ssid="Wi-Fi name"
        psk="Wi-Fi password"
}

2.3 安装使用 AVS

sudo apt update
sudo apt install mpg123 gstreamer1.0-plugins-good gstreamer1.0-plugins-bad gstreamer1.0-plugins-ugly python-gi python-gst-1.0 
sudo apt remove gstreamer1.0-omx gstreamer1.0-omx-rpi    # avoid gstreamer using HMDI audio output
sudo pip install avs

2.4 安装 Snowboy

sudo apt install python-audio libatlas-base-dev swig
git clone --depth 1 https://github.com/Kitt-AI/snowboy.git snowboy_github
cd snowboy_github
sudo apt install libatlas-base-dev swig
python setup.py build
sudo pip install --no-deps .                       # with '--no-deps' to avoid installing pyaudio from source

2.4 配置自动启动脚本

Get Started with Raspberry Pi

xiongyihui commented 6 years ago
  1. DIY a smart speaker in X minutes (based on Raspberry Pi & Amazon AVS)
  2. How to run Amazon Alexa (AVS) and Google Assistant on the same device
  3. Build a voice assistant with MyCroft, do NLU locally
  4. Interruptible voice interaction with Asoustic Echo Cancellation (AEC)
  5. Sound Source Localization
  6. Write a simplest beamforming algorithm - Delay & Sum
  7. How to check if a speaker is good or not