Added sound plugin documentation.

- Added example of how to stream audio over HTTP.

- Added Portaudio to the apt/pacman dependencies.
This commit is contained in:
Fabio Manganiello 2023-06-28 00:10:36 +02:00
parent a103ea49f1
commit ba827b0248
Signed by untrusted user: blacklight
GPG key ID: D90FBA7F76362774
2 changed files with 16 additions and 0 deletions

View file

@ -13,6 +13,18 @@ class SoundPlugin(RunnablePlugin):
""" """
Plugin to interact with a sound device. 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://<host>:<backend-port>/sound/stream.[mp3|wav|acc|ogg]?token=<your-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: Triggers:
* :class:`platypush.message.event.sound.SoundPlaybackStartedEvent` on playback start * :class:`platypush.message.event.sound.SoundPlaybackStartedEvent` on playback start
@ -29,6 +41,8 @@ class SoundPlugin(RunnablePlugin):
* **sounddevice** (``pip install sounddevice``) * **sounddevice** (``pip install sounddevice``)
* **numpy** (``pip install numpy``) * **numpy** (``pip install numpy``)
* **ffmpeg** package installed on the system * **ffmpeg** package installed on the system
* **portaudio** package installed on the system - either
``portaudio19-dev`` on Debian-like systems, or ``portaudio`` on Arch.
""" """

View file

@ -14,7 +14,9 @@ manifest:
- numpy - numpy
apt: apt:
- ffmpeg - ffmpeg
- portaudio19-dev
pacman: pacman:
- ffmpeg - ffmpeg
- portaudio
package: platypush.plugins.sound package: platypush.plugins.sound
type: plugin type: plugin