High-performance, low-latency PCM audio streaming server written in Go
AriaCast Server (Go) is a lightweight, high-performance reimplementation of the Python AriaCast Server. It transforms any device into a network audio receiver with real-time metadata synchronization, remote control, and Music Assistant integration.
Why Go? This implementation offers:
- β‘ Better Performance - Lower CPU usage and memory footprint
- π Single Binary - No dependencies, just run the executable
- π Easy Deployment - Pre-compiled binaries for all platforms
- π§ Music Assistant Integration - Native pipe support for seamless integration
- AriaCast Server (Python) - Original implementation with web dashboard and local audio playback
- AriaCast Music Assistant Plugin - Music Assistant provider integration
- WebSocket Streaming: Low-latency raw PCM transmission (48kHz/16-bit stereo)
- HTTP WAV Stream:
/stream.wavendpoint for browser/generic player compatibility - Pipe Bridge: Native pipe output for Music Assistant integration
- Playback Control: Play/pause with silent frame injection
- Real-time Metadata: Track title, artist, album, duration, position
- Artwork Support: Automatic artwork downloading and serving
- Bidirectional Control: WebSocket-based control commands
- REST API: Simple HTTP endpoints for external control
- UDP Discovery: Auto-discovery via UDP broadcast on port 12888
- Zero Configuration: Automatic IP detection and server info broadcast
- Embedded Player: Built-in responsive web player (use
--webflag) - Real-time Updates: Live metadata and playback position
- Media Controls: Play, pause, next, previous buttons
Download the binary for your platform from the Releases
# macOS (Intel)
./bin/ariacast_darwin_amd64 --pipe /tmp/music_assistant.pcm
# macOS (Apple Silicon)
./bin/ariacast_darwin_arm64 --pipe /tmp/music_assistant.pcm
# Linux (x64)
./bin/ariacast_linux_amd64 --pipe /tmp/music_assistant.pcm
# Linux (ARM - Raspberry Pi)
./bin/ariacast_linux_arm --pipe /tmp/music_assistant.pcm
# Linux (ARM64)
./bin/ariacast_linux_arm64 --pipe /tmp/music_assistant.pcm# Clone the repository
git clone https://github.com/AirPlr/Ariacast-Server-GO.git
cd Ariacast-Server-GO
# Build
./build.sh
# Run
./ariacast_OS_ARCH --webFor Music Assistant integration:
./ariacast_OS_ARCH --pipe /tmp/music_assistant.pcmThe server will:
- Create a pipe bridge to write audio data
- Start discovery service on UDP port 12888
- Listen for WebSocket connections on port 12889
- Write silence when playback is paused
./ariacast_OS_ARCH --webAccess the web player at: http://localhost:8080
- Type: Binary WebSocket
- Frame Size: 3840 bytes (20ms of PCM audio)
- Format: 48kHz, 16-bit, Stereo
- Flow: Client β Server
Handshake Response:
{
"status": "READY",
"sample_rate": 48000,
"channels": 2,
"frame_size": 3840
}- Type: JSON WebSocket
- Flow: Bidirectional
Update Metadata (Client β Server):
{
"type": "update",
"data": {
"title": "Song Title",
"artist": "Artist Name",
"album": "Album Name",
"artworkUrl": "https://example.com/cover.jpg",
"durationMs": 240000,
"positionMs": 45000,
"isPlaying": true
}
}Broadcast to Clients (Server β Clients):
{
"type": "metadata",
"data": {
"title": "Song Title",
"artist": "Artist Name",
"album": "Album Name",
"artwork_url": "https://example.com/cover.jpg",
"duration_ms": 240000,
"position_ms": 45000,
"is_playing": true
}
}- Type: JSON WebSocket
- Flow: Bidirectional
Control Commands:
{"action": "play"}
{"action": "pause"}
{"action": "next"}
{"action": "previous"}Infinite WAV stream for browser playback.
Serves the current track's artwork (JPEG).
Send control commands via HTTP:
curl -X POST http://localhost:12889/api/command \
-H "Content-Type: application/json" \
-d '{"action": "pause"}'Alternative artwork endpoint for Music Assistant.
Discovery Request:
DISCOVER_AUDIOCAST
Response:
{
"server_name": "MusicAssistant AriaCast Receiver",
"ip": "192.168.1.100",
"port": 12889,
"samplerate": 48000,
"channels": 2
}βββββββββββββββββββββββββββββββββββββββ
β AriaCast Client/Source β
β (Music Assistant, Custom Client) β
ββββββββββββββββ¬βββββββββββββββββββββββ
β
β UDP Discovery (12888)
β WebSocket (12889)
β
ββββββββββββββββΌβββββββββββββββββββββββ
β AriaCast Go Server β
β ββββββββββββββββββββββββββββββββ β
β β Discovery Service (UDP) β β
β ββββββββββββββββββββββββββββββββ€ β
β β Audio Handler (/audio) β β
β ββββββββββββββββββββββββββββββββ€ β
β β Metadata Handler (/metadata) β β
β ββββββββββββββββββββββββββββββββ€ β
β β Control Handler (/control) β β
β ββββββββββββββββββββββββββββββββ€ β
β β Pipe Bridge β Named Pipe β β
β ββββββββββββββββββββββββββββββββ€ β
β β Web Dashboard (optional) β β
β ββββββββββββββββββββββββββββββββ β
ββββββββββββββββ¬βββββββββββββββββββββββ
β
β Named Pipe (PCM)
β
ββββββββββββββββΌβββββββββββββββββββββββ
β Music Assistant Player β
β (or other consumer) β
βββββββββββββββββββββββββββββββββββββββ
| Feature | Python Version | Go Version |
|---|---|---|
| Local Audio Playback | β (sounddevice) | β (pipe only) |
| Pipe Output | β (native, optimized) | |
| Web Dashboard | β (rich, visualizer) | β (minimal) |
| mDNS Discovery | β (Bonjour) | β (UDP only) |
| Dependencies | Many (aiohttp, numpy, etc.) | 1 (gorilla/websocket) |
| CPU Usage | ~5-10% | ~1-2% |
| Memory | ~50-80 MB | ~10-15 MB |
| Deployment | Requires Python + packages | Single binary |
| Pause Control | Limited | β (silence injection) |
Choose Python version if you need:
- Local audio playback via sounddevice
- Rich web interface with visualizer
- mDNS/Bonjour discovery
Choose Go version if you need:
- Music Assistant pipe integration
- Low resource usage
- Single binary deployment
- Better performance on embedded devices (Raspberry Pi)
The server is configured with sensible defaults. To modify configuration, edit the ServerConfig struct in main.go:
Config: &ServerConfig{
ServerName: "MusicAssistant AriaCast Receiver",
StreamingPort: 12889,
DiscoveryPort: 12888,
Audio: AudioConfig{
SampleRate: 48000,
Channels: 2,
SampleWidth: 2,
FrameDurationMs: 20,
},
}FROM golang:1.21-alpine AS builder
WORKDIR /app
COPY . .
RUN go build -o ariacast main.go
FROM alpine:latest
COPY --from=builder /app/ariacast /usr/local/bin/
ENTRYPOINT ["ariacast"]
CMD ["--pipe", "/tmp/music_assistant.pcm", "--web"]Contributions are welcome! Please feel free to submit pull requests, report issues, or suggest enhancements.
# Install dependencies
go mod download
# Run with hot reload (requires air)
air
# Build for all platforms
./build.sh
# Run tests
go test ./...MIT License - see LICENSE file for details
- Original Python implementation: AriaCast Server
- WebSocket library: gorilla/websocket
- Issues: GitHub Issues
- Discussions: GitHub Discussions
- Python Version: AriaCast Server Issues
Made with β€οΈ for Music Assistant and the audio streaming community