From ba827b02481b14837a8d4635460b9bf9003a60f5 Mon Sep 17 00:00:00 2001 From: Fabio Manganiello Date: Wed, 28 Jun 2023 00:10:36 +0200 Subject: [PATCH] Added `sound` plugin documentation. - Added example of how to stream audio over HTTP. - Added Portaudio to the apt/pacman dependencies. --- platypush/plugins/sound/__init__.py | 14 ++++++++++++++ platypush/plugins/sound/manifest.yaml | 2 ++ 2 files changed, 16 insertions(+) diff --git a/platypush/plugins/sound/__init__.py b/platypush/plugins/sound/__init__.py index 70d41029..88f432e0 100644 --- a/platypush/plugins/sound/__init__.py +++ b/platypush/plugins/sound/__init__.py @@ -13,6 +13,18 @@ class SoundPlugin(RunnablePlugin): """ Plugin to interact with a sound device. + Among the other features, enabling this plugin allows you to stream audio + over HTTP from the device where the application is running, if + :class:`platypush.backend.http.HttpBackend` is enabled. + + Simply open + ``http://:/sound/stream.[mp3|wav|acc|ogg]?token=`` + to access live recording from the audio device. + + It can also be used as a general-purpose audio player and synthesizer, + supporting both local and remote audio resources, as well as a MIDI-like + interface through the :meth:`.play` command. + Triggers: * :class:`platypush.message.event.sound.SoundPlaybackStartedEvent` on playback start @@ -29,6 +41,8 @@ class SoundPlugin(RunnablePlugin): * **sounddevice** (``pip install sounddevice``) * **numpy** (``pip install numpy``) * **ffmpeg** package installed on the system + * **portaudio** package installed on the system - either + ``portaudio19-dev`` on Debian-like systems, or ``portaudio`` on Arch. """ diff --git a/platypush/plugins/sound/manifest.yaml b/platypush/plugins/sound/manifest.yaml index c44f0f17..d8166fe0 100644 --- a/platypush/plugins/sound/manifest.yaml +++ b/platypush/plugins/sound/manifest.yaml @@ -14,7 +14,9 @@ manifest: - numpy apt: - ffmpeg + - portaudio19-dev pacman: - ffmpeg + - portaudio package: platypush.plugins.sound type: plugin