Skip to content
forked from respeaker/avs

python implementation of alexa voice service app, 支持DuerOS

License

Notifications You must be signed in to change notification settings

maskinoshita/avs

 
 

Repository files navigation

Python Alexa Voice Service App

Features

  • Support Alexa Voice Service API v20160207
  • Support multiple audio players: gstreamer 1.0, mpv and mpg123
  • 支持Baidu DuerOS

Options

  1. Player

    We have 3 players (mpv, mpg123 and gstreamer) to use. SpeechSynthesizer and Alerts prefer mpg123 which is more responsive. AudioPlayer likes gstreamer > mpv > mpg123. Gstreamer supports more audio format and works well on raspberry pi. We can also specify the player of AudioPlayer using the environment variable PLAYER.

  2. Recorder

    2 recorders (pyaudio & arecord) are available. We can use environment variable RECORDER to specify the recorder. For example, run RECORDER=pyaudio alexa-tap will use pyaudio as the recorder. By default, arecord is used as the recorder.

  3. Keyword detector (optional)

    Use PocketSphinx or Snowboy. To use pocketsphinx, install respeaker python library and pocketsphinx. To use Snowboy, go to Snowboy's Github to install it.

If you use raspberry pi and gstreamer, it is likely that gstreamer's default audio sink is GstOMXHdmiAudioSink. It ignores ALSA configurations and outputs audio to HDMI. If you don't want to use HDMI audio output, you should run sudo apt remove gstreamer1.0-omx gstreamer1.0-omx-rpi

Requirements

  • For ReSpeaker Core (MT7688)

    gstreamer1.0, pyaudio and pocketsphinx and respeaker python library are already installed by default, just run pip install avs

  • For Debian/Ubuntu/Raspbian

    sudo apt-install mpg123 mpv
    sudo apt-get install gstreamer1.0-plugins-good gstreamer1.0-plugins-bad gstreamer1.0-plugins-ugly \
    gir1.2-gstreamer-1.0 python-gi python-gst-1.0
    sudo apt-get install python-pyaudio
    

Get started