Skip to main content

An open source implementation of the audio server part of the Hermes protocol

Project description

Hermes Audio Server

Build status Maintainability Code quality Python versions GitHub license

Hermes Audio server implements the audio server part of the Hermes protocol defined by Snips.

It's meant to be used with Rhasspy, an offline, multilingual voice assistant toolkit that works with Home Assistant and is completely open source.

With Hermes Audio Server, you can use the microphone and speaker of your computer (such as a Raspberry Pi) as remote audio input and output for a Rhasspy system.

System requirements

Hermes Audio Server requires Python 3. It has been tested on a Raspberry Pi running Raspbian 9.8, but in principle it should be cross-platform. Please open an issue on GitHub when you encounter problems on your platform.

Installation

You can install the dependencies like this:

sudo apt install portaudio19-dev
pip3 install hermes-audio-server 

Configuration

Hermes Audio Server is configured in the JSON file /etc/hermes-audio-server.json, which has the following format:

{
    "site": "default",
    "mqtt": {
        "host": "localhost",
        "port": 1883,
        "authentication": {
            "username": "foobar",
            "password": "secretpassword"
        },
        "tls": {
            "ca_certificates": "",
            "client_certificate": "",
            "client_key": ""
        }
    }
}

All keys are optional. The default behaviour is to connect with localhost:1883 without authentication and TLS and to use default as the site ID.

Currently Hermes Audio Server uses the system's default microphone and speaker. In the next version this will be configurable.

Running Hermes Audio Server

Hermes Audio Server consists of two commands: Hermes Audio Player that receives WAV files on MQTT and plays them on the speaker, and Hermes Audio Recorder that records WAV files from the microphone and sends them as audio frames on MQTT.

You can run the Hermes Audio Player like this:

hermes-audio-player

You can run the Hermes Audio Recorder like this:

hermes-audio-recorder

You can run both, or only one of them if you only want to use the speaker or microphone.

Usage

Both commands know the --help option that gives you more information about the recognized options. For instance:

usage: hermes-audio-player [-h] [-v] [-V] [-c CONFIG]

hermes-audio-player is an audio server implementing the playback part of
    the Hermes protocol.

optional arguments:
  -h, --help            show this help message and exit
  -v, --verbose         use verbose output
  -V, --version         print version information and exit
  -c CONFIG, --config CONFIG
                        configuration file [default: /etc/hermes-audio-
                        server.json]

TODO list

The following features will be developed soon:

  • Add logging
  • Make it possible to run the commands as daemons (and add systemd unit files)
  • Add an option to let the user choose the audio devices
  • Add more documentation

Other interesting projects

If you find Hermes Audio Server interesting, also have a look at the following projects:

  • Rhasspy: An offline, multilingual voice assistant toolkit that works with Home Assistant and is completely open source.
  • Snips Led Control: An easy way to control the leds of your Snips-compatible device, with led patterns when the hotword is detected, the device is listening, speaking, idle, ...
  • Matrix-Voice-ESP32-MQTT-Audio-Streamer: The equivalent of Hermes Audio Server for a Matrix Voice ESP32 board, including LED control and OTA updates.
  • OpenSnips: A collection of open source projects related to the Snips voice platform.

License

This project is provided by Koen Vervloesem as open source software with the MIT license. See the LICENSE file for more information.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

hermes-audio-server-0.0.2.tar.gz (10.8 kB view details)

Uploaded Source

Built Distribution

hermes_audio_server-0.0.2-py3-none-any.whl (14.1 kB view details)

Uploaded Python 3

File details

Details for the file hermes-audio-server-0.0.2.tar.gz.

File metadata

  • Download URL: hermes-audio-server-0.0.2.tar.gz
  • Upload date:
  • Size: 10.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.21.0 setuptools/40.8.0 requests-toolbelt/0.9.1 tqdm/4.31.1 CPython/3.7.3

File hashes

Hashes for hermes-audio-server-0.0.2.tar.gz
Algorithm Hash digest
SHA256 08c6ef5bd8ffb83c1dd6654853b471a34300f5c2e8ce03e72d0f5dc1f4389808
MD5 9ccb4aa12aaa8ede829c3e6d56dcaa72
BLAKE2b-256 4c101bbfaa2fe1e0eb89ea07fbee8501ee88ae43d9e441f09d0d88d9ed0a3232

See more details on using hashes here.

File details

Details for the file hermes_audio_server-0.0.2-py3-none-any.whl.

File metadata

  • Download URL: hermes_audio_server-0.0.2-py3-none-any.whl
  • Upload date:
  • Size: 14.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.21.0 setuptools/40.8.0 requests-toolbelt/0.9.1 tqdm/4.31.1 CPython/3.7.3

File hashes

Hashes for hermes_audio_server-0.0.2-py3-none-any.whl
Algorithm Hash digest
SHA256 c661edb0e7292c622b95f76e5187299e4365342d830868fc76839b2a79258078
MD5 83a16eda1a7ed5ea196ae8bf37804105
BLAKE2b-256 a069f3f91e9005a364b68a8e5c9d4b802c2d9544c024042eeb494f241a1b1eb2

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page