- Support Alexa Voice Service API v20160207
- Support multiple audio players: gstreamer 1.0, mpv and mpg123
- 支持DuerOS
Choose a player from mpv
, mpg123
and gstreamer.
SpeechSynthesizer
and Alerts
prefer mpg123
as it 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
.
- one of mpg123, mpv and gstreamer 1.0
- python-pyaudio
- respeaker python library and pocketsphinx (optional, for hands-free keyword spotting)
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
-
For ReSpeaker Core (MT7688)
gstreamer1.0, pyaudio and pocketsphinx and respeaker python library are already installed by default, just run
pip install avs
-
For Ubuntu/Debian
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 sudo pip install avs respeaker pocketsphinx # requires gcc toolchain and libpulse-dev
-
run
alexa-audio-check
to check if recording & playing is OK. If RMS is not zero, recording is OK, if you can hear alarm, playing is OK$alexa-audio-check RMS: 41 RMS: 43
-
run
alexa-auth
to login Amazon, it will save authorization information to~/.avs.json
-
run
alexa-tap
, then press Enter to talk with alexa -
run
alexa
, then use "alexa" to start with conversation with alexa, for example, "alexa, what time is it"
If you want to use a specified player, use the environment variable
PLAYER
to specify it, such asPLAYER=mpv alexa-tap
orPLAYER=mpg123 alexa
orPLAYER=gstreamer alexa
- Speaker interface
- Notifications interface
If you want to use your own client id and product id, try:
-
create a file named config.json with your product_id, client_id and client_secret
{ "product_id": "x", "client_id": "y", "client_secret": "z" }
-
run
alexa-auth -c config.json
-
run
alexa-tap
oralexa
GNU General Public License v3
This project is based on nicholas-gh/python-alexa-client
This package was created with Cookiecutter_ and the audreyr/cookiecutter-pypackage project template.