{ "info": { "author": "Koen Vervloesem", "author_email": "koen@vervloesem.eu", "bugtrack_url": null, "classifiers": [ "Development Status :: 3 - Alpha", "Environment :: Console", "License :: OSI Approved :: MIT License", "Operating System :: POSIX", "Programming Language :: Python", "Programming Language :: Python :: 3.5", "Programming Language :: Python :: 3.6", "Programming Language :: Python :: 3.7", "Programming Language :: Python :: 3 :: Only", "Programming Language :: Python :: Implementation :: CPython", "Topic :: Home Automation", "Topic :: Multimedia :: Sound/Audio :: Capture/Recording", "Topic :: Multimedia :: Sound/Audio :: Players" ], "description": "# Hermes Audio Server\n\n[![Build status](https://api.travis-ci.com/koenvervloesem/hermes-audio-server.svg?branch=master)](https://travis-ci.com/koenvervloesem/hermes-audio-server) [![Maintainability](https://api.codeclimate.com/v1/badges/9ae3a46a15a85c8b44f3/maintainability)](https://codeclimate.com/github/koenvervloesem/hermes-audio-server/maintainability) [![Code quality](https://api.codacy.com/project/badge/Grade/02647c1d9d214b8a97ed124ccf48839f)](https://www.codacy.com/app/koenvervloesem/hermes-audio-server) [![Python versions](https://img.shields.io/badge/python-3.5|3.6|3.7-blue.svg)](https://www.python.org) [![PyPI package version](https://img.shields.io/pypi/v/hermes-audio-server.svg)](https://pypi.python.org/pypi/hermes-audio-server) [![GitHub license](https://img.shields.io/github/license/koenvervloesem/hermes-audio-server.svg)](https://github.com/koenvervloesem/hermes-audio-server/blob/master/LICENSE)\n\nHermes Audio server implements the audio server part of the [Hermes protocol](https://docs.snips.ai/reference/hermes) defined by [Snips](http://snips.ai).\n\nIt's meant to be used with [Rhasspy](https://rhasspy.readthedocs.io), an offline, multilingual voice assistant toolkit that works with [Home Assistant](https://www.home-assistant.io) and is completely open source.\n\nWith 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.\n\n## System requirements\n\nHermes Audio Server requires Python 3. It has been tested on a Raspberry Pi running Raspbian 9.8 and an x86_64 laptop with Ubuntu 19.04, but in principle it should be cross-platform. Please [open an issue](https://github.com/koenvervloesem/hermes-audio-server/issues) on GitHub when you encounter problems or when the software exits with the message that your platform is not supported.\n\n## Installation\n\nYou can install Hermes Audio Server and its dependencies like this:\n\n```shell\nsudo apt install portaudio19-dev\nsudo pip3 install hermes-audio-server\n```\n\nNote: this installs Hermes Audio Server globally. If you want to install Hermes Audio Server in a Python virtual environment, drop the `sudo`.\n\n## Running as a service\nYou can run Hermes Audio Server as a service.\n\nIt's recommended to run it as a system user. Create this user without a login shell and without creating a home directory for the user:\n\n```shell\nsudo useradd -r -s /bin/false hermes-audio-server\n```\n\nThis user also needs access to your audio devices:\n\n```shell\nsudo usermod -a -G audio hermes-audio-server\n```\n\n## Configuration\n\nHermes Audio Server is configured in the JSON file `/etc/hermes-audio-server.json`, which has the following format:\n\n```json\n{\n \"site\": \"default\",\n \"mqtt\": {\n \"host\": \"localhost\",\n \"port\": 1883,\n \"authentication\": {\n \"username\": \"foobar\",\n \"password\": \"secretpassword\"\n },\n \"tls\": {\n \"ca_certificates\": \"\",\n \"client_certificate\": \"\",\n \"client_key\": \"\"\n }\n },\n \"vad\": {\n \"mode\": 0,\n \"silence\": 2,\n \"status_messages\": true\n }\n}\n```\n\nNote that this supposes that you're using authentication and TLS for the connection to your MQTT broker and that this enables the experimental Voice Activity Detection (see below).\n\nAll keys in the configuration file are optional. The default behaviour is to connect with `localhost:1883` without authentication and TLS and to use `default` as the site ID and disable Voice Activity Detection. A configuration file for this situation would like like this:\n\n```json\n{\n \"site\": \"default\",\n \"mqtt\": {\n \"host\": \"localhost\",\n \"port\": 1883\n }\n}\n```\n\nCurrently Hermes Audio Server uses the system's default microphone and speaker. In a future version this will be configurable.\n\n### Voice Activity Detection\nVoice Activity Detection is an experimental feature in Hermes Audio Server, which is disabled by default. It is based on [py-webrtcvad](https://github.com/wiseman/py-webrtcvad) and tries to suppress sending audio frames when there's no speech. Note that the success of this attempt highly depends on your microphone, your environment and your configuration of the VAD feature. Voice Activity Detection in Hermes Audio Server should not be considered a privacy feature, but a feature to save network bandwidth. If you really don't want to send audio frames on your network except when giving voice commands, you should run a wake word service on your device and only then start streaming audio to your Rhasspy server until the end of the command.\n\nIf the `vad` key is not specified in the configuration file, Voice Activity Detection is not enabled and all recorded audio frames are streamed continuously on the network. If you don't want this, specify the `vad` key to only stream audio when voice activity is detected. You can configure the VAD feature with the following subkeys:\n\n* `mode`: This should be an integer between 0 and 3. 0 is the least aggressive about filtering out non-speech, 3 is the most aggressive. Defaults to 0.\n* `silence`: This defines how much silence (no speech detected) in seconds has to go by before Hermes Audio Recorder considers it the end of a voice message. Defaults to 2. Make sure that this value is higher than or equal to `min_sec` [in the configuration of WebRTCVAD](https://rhasspy.readthedocs.io/en/latest/command-listener/#webrtcvad) for the command listener of Rhasspy, otherwise the audio stream for the command listener could be aborted too soon.\n* `status_messages`: This is a boolean: `true` or `false`. Specifies whether or not Hermes Audio Recorder sends messages on MQTT when it detects the start or end of a voice message. Defaults to `false`. This is useful for debugging, when you want to find the right values for `mode` and `silence`.\n\n## Running Hermes Audio Server\n\nHermes 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.\n\nYou can run the Hermes Audio Player like this:\n\n```shell\nhermes-audio-player\n```\n\nYou can run the Hermes Audio Recorder like this:\n\n```shell\nhermes-audio-recorder\n```\n\nYou can run both, or only one of them if you only want to use the speaker or microphone.\n\n## Usage\n\nBoth commands know the `--help` option that gives you more information about the recognized options. For instance:\n\n```shell\nusage: hermes-audio-player [-h] [-v] [-V] [-c CONFIG]\n\nhermes-audio-player is an audio server implementing the playback part of\n the Hermes protocol.\n\noptional arguments:\n -h, --help show this help message and exit\n -v, --verbose use verbose output\n -V, --version print version information and exit\n -c CONFIG, --config CONFIG\n configuration file [default: /etc/hermes-audio-\n server.json]\n -d, --daemon run as daemon\n```\n\n## Known issues / TODO list\n\n* You can't choose the audio devices yet: the commands use the system's default microphone and speaker.\n* This project is really a minimal implementation of the audio server part of the Hermes protocol, meant to be used with Rhasspy. It's not a drop-in replacement for snips-audio-server, as it lacks [additional metadata](https://github.com/snipsco/snips-issues/issues/144#issuecomment-494054082) in the WAV frames.\n\n## Changelog\n\n* 0.2.0 (2019-06-04): Added logging and a daemon mode.\n* 0.1.1 (2019-05-30): Made the audio player more robust when receiving an incorrect WAV file.\n* 0.1.0 (2019-05-16): Added Voice Activity Detection option.\n* 0.0.2 (2019-05-11): First public version.\n\n## Other interesting projects\n\nIf you find Hermes Audio Server interesting, have a look at the following projects too:\n\n* [Rhasspy](https://rhasspy.readthedocs.io): An offline, multilingual voice assistant toolkit that works with [Home Assistant](https://www.home-assistant.io) and is completely open source.\n* [Snips Led Control](https://github.com/Psychokiller1888/snipsLedControl): 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, ...\n* [Matrix-Voice-ESP32-MQTT-Audio-Streamer](https://github.com/Romkabouter/Matrix-Voice-ESP32-MQTT-Audio-Streamer): The equivalent of Hermes Audio Server for a Matrix Voice ESP32 board, including LED control and OTA updates.\n* [OpenSnips](https://github.com/syntithenai/opensnips): A collection of open source projects related to the Snips voice platform.\n\n## License\n\nThis project is provided by [Koen Vervloesem](mailto:koen@vervloesem.eu) as open source software with the MIT license. See the LICENSE file for more information.\n\n\n", "description_content_type": "text/markdown", "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/koenvervloesem/hermes-audio-server", "keywords": "hermes snips python3 rhasspy audio-player audio-recorder audio-server snips-audio-server hermes-protocol voice voice-control", "license": "MIT License", "maintainer": "", "maintainer_email": "", "name": "hermes-audio-server", "package_url": "https://pypi.org/project/hermes-audio-server/", "platform": "", "project_url": "https://pypi.org/project/hermes-audio-server/", "project_urls": { "Documentation": "https://github.com/koenvervloesem/hermes-audio-server", "Homepage": "https://github.com/koenvervloesem/hermes-audio-server", "Source": "https://github.com/koenvervloesem/hermes-audio-server", "Tracker": "https://github.com/koenvervloesem/hermes-audio-server/issues" }, "release_url": "https://pypi.org/project/hermes-audio-server/0.2.0/", "requires_dist": [ "colorlog", "humanfriendly", "paho-mqtt", "plac", "pyaudio", "python-daemon", "webrtcvad" ], "requires_python": ">=3", "summary": "An open source implementation of the audio server part of the Hermes protocol", "version": "0.2.0" }, "last_serial": 5358596, "releases": { "0.0.1": [ { "comment_text": "", "digests": { "md5": "10cda320018e0738d82f726265c62a05", "sha256": "5a36513be273cb17a67324141e4928f9fdb028afd809ef5a574502ca101adc3b" }, "downloads": -1, "filename": "hermes_audio_server-0.0.1-py3.7.egg", "has_sig": false, "md5_digest": "10cda320018e0738d82f726265c62a05", "packagetype": "bdist_egg", "python_version": "3.7", "requires_python": null, "size": 23720, "upload_time": "2019-05-11T20:31:41", "url": "https://files.pythonhosted.org/packages/25/3d/9886c13827ab37b4618934cf8b10b179be0138e6f7d1dc0bef5a4e7d07d3/hermes_audio_server-0.0.1-py3.7.egg" }, { "comment_text": "", "digests": { "md5": "1fcd6cbdbb4debb42985e568a6dc2f54", "sha256": "13e109a5c6566cc4fc0556a63929bfbe567491deed35af7c2cd7095c8473222f" }, "downloads": -1, "filename": "hermes_audio_server-0.0.1-py3-none-any.whl", "has_sig": false, "md5_digest": "1fcd6cbdbb4debb42985e568a6dc2f54", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 13020, "upload_time": "2019-05-11T20:31:39", "url": "https://files.pythonhosted.org/packages/a6/b0/9ea165d2a52c18d402c832b79566248832464a29463aed0384c788aacd0f/hermes_audio_server-0.0.1-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "8020168fcb44b449110fab7aaa9169d0", "sha256": "d2ef3a59a7edacda846290251507a0b2fbc1317648b2cf998809029c54fca577" }, "downloads": -1, "filename": "hermes-audio-server-0.0.1.tar.gz", "has_sig": false, "md5_digest": "8020168fcb44b449110fab7aaa9169d0", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 11011, "upload_time": "2019-05-11T20:31:43", "url": "https://files.pythonhosted.org/packages/8b/85/c96280f75896c2d2fe2a7f152981e06a91858f54bbb241ef925dece0466c/hermes-audio-server-0.0.1.tar.gz" } ], "0.0.2": [ { "comment_text": "", "digests": { "md5": "83a16eda1a7ed5ea196ae8bf37804105", "sha256": "c661edb0e7292c622b95f76e5187299e4365342d830868fc76839b2a79258078" }, "downloads": -1, "filename": "hermes_audio_server-0.0.2-py3-none-any.whl", "has_sig": false, "md5_digest": "83a16eda1a7ed5ea196ae8bf37804105", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 14094, "upload_time": "2019-05-11T20:39:28", "url": "https://files.pythonhosted.org/packages/a0/69/f3f91e9005a364b68a8e5c9d4b802c2d9544c024042eeb494f241a1b1eb2/hermes_audio_server-0.0.2-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "9ccb4aa12aaa8ede829c3e6d56dcaa72", "sha256": "08c6ef5bd8ffb83c1dd6654853b471a34300f5c2e8ce03e72d0f5dc1f4389808" }, "downloads": -1, "filename": "hermes-audio-server-0.0.2.tar.gz", "has_sig": false, "md5_digest": "9ccb4aa12aaa8ede829c3e6d56dcaa72", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 10795, "upload_time": "2019-05-11T20:40:04", "url": "https://files.pythonhosted.org/packages/4c/10/1bbfaa2fe1e0eb89ea07fbee8501ee88ae43d9e441f09d0d88d9ed0a3232/hermes-audio-server-0.0.2.tar.gz" } ], "0.1.0": [ { "comment_text": "", "digests": { "md5": "88f019d20a55ab51bf8ad1ee3312bc1f", "sha256": "ced11b674779a8b38637487fd25ebc858cf243a17fe3bae2aca44f9f439f7225" }, "downloads": -1, "filename": "hermes_audio_server-0.1.0-py3-none-any.whl", "has_sig": false, "md5_digest": "88f019d20a55ab51bf8ad1ee3312bc1f", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 20259, "upload_time": "2019-05-16T18:44:48", "url": "https://files.pythonhosted.org/packages/27/f4/590c157f18236b06c619bbd2a3fda3ee53d1dcbc1d0a911cff5329842f57/hermes_audio_server-0.1.0-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "16aeb2a88a5b87b8417bd1bb9bff2805", "sha256": "963652d8534cadc59dcf6b241270b3aae8d386339a2d5c9928b3d9441c32a1f7" }, "downloads": -1, "filename": "hermes-audio-server-0.1.0.tar.gz", "has_sig": false, "md5_digest": "16aeb2a88a5b87b8417bd1bb9bff2805", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 13519, "upload_time": "2019-05-16T18:44:51", "url": "https://files.pythonhosted.org/packages/64/92/7002f2c2a7f5259eda832ed0a39c269bf4e7ca93758f0b87dacff20ea6a1/hermes-audio-server-0.1.0.tar.gz" } ], "0.1.1": [ { "comment_text": "", "digests": { "md5": "6005b06646824526fcaa26a9bc485c68", "sha256": "616f4b17af7e829c27c50ea5a6813b5cbf4e3984b119737897797535be9ee089" }, "downloads": -1, "filename": "hermes_audio_server-0.1.1-py3-none-any.whl", "has_sig": false, "md5_digest": "6005b06646824526fcaa26a9bc485c68", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 15886, "upload_time": "2019-05-30T15:37:46", "url": "https://files.pythonhosted.org/packages/6f/33/2c93f6999fa22c5d437475b6e4665ff83cdb6af79f6fade99120a90bf6e7/hermes_audio_server-0.1.1-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "02ac75bae40bb078258b9fc57d871226", "sha256": "66d69e0cd3cd21057b9b35b9b27137ae569e3f44a2d8bb2e7d1c2246e8d37e85" }, "downloads": -1, "filename": "hermes-audio-server-0.1.1.tar.gz", "has_sig": false, "md5_digest": "02ac75bae40bb078258b9fc57d871226", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 14123, "upload_time": "2019-05-30T15:37:49", "url": "https://files.pythonhosted.org/packages/8b/7c/f2e2aebf27d1128444292ab832bd0b1965984a90e8af06ea811071a97d9d/hermes-audio-server-0.1.1.tar.gz" } ], "0.2.0": [ { "comment_text": "", "digests": { "md5": "b6cf4cae6fbae250302d04339eca1b57", "sha256": "57ac07150ba645196c2ecd4035d8f8ab01c4dde278620c240cdd0612b4dd9575" }, "downloads": -1, "filename": "hermes_audio_server-0.2.0-py3-none-any.whl", "has_sig": false, "md5_digest": "b6cf4cae6fbae250302d04339eca1b57", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": ">=3", "size": 20027, "upload_time": "2019-06-04T16:32:36", "url": "https://files.pythonhosted.org/packages/84/c5/3388a4270da809151b7ba662a0f54004bcf8678947eba569a64421882387/hermes_audio_server-0.2.0-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "09ece810babd5d7fffa25ada2b00d05b", "sha256": "8f62772c407966af5f2198a098d23022532b6cbc7e10bb997163a84d11ff9a9d" }, "downloads": -1, "filename": "hermes-audio-server-0.2.0.tar.gz", "has_sig": false, "md5_digest": "09ece810babd5d7fffa25ada2b00d05b", "packagetype": "sdist", "python_version": "source", "requires_python": ">=3", "size": 16941, "upload_time": "2019-06-04T16:32:45", "url": "https://files.pythonhosted.org/packages/90/9f/331751fcb765710081f72a5a1f52a72bd4bee7496db544e71c2a82f0c265/hermes-audio-server-0.2.0.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "b6cf4cae6fbae250302d04339eca1b57", "sha256": "57ac07150ba645196c2ecd4035d8f8ab01c4dde278620c240cdd0612b4dd9575" }, "downloads": -1, "filename": "hermes_audio_server-0.2.0-py3-none-any.whl", "has_sig": false, "md5_digest": "b6cf4cae6fbae250302d04339eca1b57", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": ">=3", "size": 20027, "upload_time": "2019-06-04T16:32:36", "url": "https://files.pythonhosted.org/packages/84/c5/3388a4270da809151b7ba662a0f54004bcf8678947eba569a64421882387/hermes_audio_server-0.2.0-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "09ece810babd5d7fffa25ada2b00d05b", "sha256": "8f62772c407966af5f2198a098d23022532b6cbc7e10bb997163a84d11ff9a9d" }, "downloads": -1, "filename": "hermes-audio-server-0.2.0.tar.gz", "has_sig": false, "md5_digest": "09ece810babd5d7fffa25ada2b00d05b", "packagetype": "sdist", "python_version": "source", "requires_python": ">=3", "size": 16941, "upload_time": "2019-06-04T16:32:45", "url": "https://files.pythonhosted.org/packages/90/9f/331751fcb765710081f72a5a1f52a72bd4bee7496db544e71c2a82f0c265/hermes-audio-server-0.2.0.tar.gz" } ] }