A headless, networked audio server written in Rust that uses GStreamer to stream and receive audio across devices. Designed for low-latency audio control in distributed home systems like Raspberry Pi clusters, laptops, or PCs.
- Rust / Cargo
- GStreamer
On linux, first install GStreamer
sudo apt-get install libgstreamer1.0-dev libgstreamer-plugins-base1.0-dev libgstreamer-plugins-bad1.0-dev gstreamer1.0-plugins-base gstreamer1.0-plugins-good gstreamer1.0-plugins-bad gstreamer1.0-plugins-ugly gstreamer1.0-libav gstreamer1.0-tools gstreamer1.0-x gstreamer1.0-alsa gstreamer1.0-gl gstreamer1.0-gtk3 gstreamer1.0-qt5 gstreamer1.0-pulseaudio gstreamer1.0-tools gstreamer1.0-plugins-base-apps
and if cargo is installed, just run
cargo run
- One-way audio streaming from one device to another
- Plays all output of one device on another
- allows for one way microphone pass, but not bidirectional
- Simple Axum-based HTTP server to start sender or receiver on request
- dicover devices running engine
- play audio locally
- play audio remote (files, streams, etc.)
- mic broadcast / sending
- spotify
There are 5 end points:
sendwhich takes as input the source (pulsesrc for example), device (can be found withpactl list sources short) a host to send audio to and a port. Returns a success message andsession_idwhich is needed to terminate the pipe if needed.- request body example:
{"source":"pulsesrc","device":"alsa_output.pci-0000_00_1f.3.analog-stereo.monitor","host":"192.168.1.69","port":"5004"} - return example:
{"host":"192.168.1.69","port":"5004","status":"success","session_id":"e6ad85f3-391f-4d60-b883-7172324deab5"}
- request body example:
receivewhich takes as input just the port (the same as the one used on a send request). Returns a success message andsession_idwhich is needed to terminate the pipe if needed.- request body example:
{"port":"5004"} - return example:
{"status":"success","session_id":"149bcfbe-cdf0-41b8-afc6-86704d04d1da"}
- request body example:
stop_sendwhich takes as input the session id, and then terminates the send session. Returns a success message if ok.- request body example:
{"session_id":"e6ad85f3-391f-4d60-b883-7172324deab5"} - return example:
{"status":"success","session_id":null"}
- request body example:
stop_receivewhich takes as input the session id, and then terminates the send session. Returns a success message if ok.- request body example:
{"session_id":"149bcfbe-cdf0-41b8-afc6-86704d04d1da"} - return example:
{"status":"success","session_id":null"}
- request body example:
fetch_sendable_deviceswhich will return a list of audio devices that a source device can use to send audio thru the stream, this will include microphone inputs, full desktop audio outputs and any other such sources.- It is a get request so no body
- return example:
{"device_list":[{"source":"pulsesrc","device":"alsa_output.pci-0000_00_1f.3.analog-stereo.monitor"},{"source":"pulsesrc","device":"alsa_input.pci-0000_00_1f.3.analog-stereo"},{"source":"pulsesink","device":"alsa_output.pci-0000_00_1f.3.analog-stereo"}]}
If running an intance, can use curl to send requests, for example:
curl -H 'Content-Type: application/json' -d '{"port":"5004"}' -X POST 127.0.0.1:3000/receive
curl -H 'Content-Type: application/json' -d '{"source":"pulsesrc","device":"alsa_output.pci-0000_00_1f.3.analog-stereo.monitor","host":"192.168.1.69","port":"5004"}' -X POST 127.0.0.1:3000/send