π Executive Summary & User Story
As a continuous listener,
I want station changes to execute instantly with a smooth, beat-aware DJ crossfade,
So that I never hear 3β5 seconds of dead silence, audio pops, or buffering lag when surfing stations.
π― Problem Statement & Community Context
In every existing command-line radio player, switching stations stops the current stream, creates an awkward 3β5 second silence while establishing a new TCP connection and buffering audio, and then abruptly starts the new stream.
ποΈ Detailed Functional Requirements
1. Dual-Deck Audio Engine Architecture
- Refactor
pkg/player/ to maintain two independent playback decks: Deck A and Deck B.
- While
Deck A is playing live to audio output, selecting a new station assigns it to Deck B.
2. Zero-Gap Pre-Buffering & Crossfading
- When user presses
n, p, or selects a station with Enter:
Deck B connects to the new stream URL and pre-buffers 1.5 seconds of audio in the background.
Deck A continues playing without interruption.
- The moment
Deck B is ready, halpradio initiates a smooth equal-power crossfade (configurable duration: 1.0sβ5.0s, default 2.5s).
Deck A volume scales 1.0 -> 0.0 while Deck B volume scales 0.0 -> 1.0.
- Once crossfade completes,
Deck A terminates its network connection and releases resources.
3. Visual DJ Deck Transition Indicator
- Display visual deck status (
[A βΊ B] crossfade meter) in the playerbar during transitions.
π₯οΈ TUI & Visual Design
βΆ Transitioning: [SomaFM] βββΊ [Nightwave Plaza]
[ Crossfade: ββββββββββββββββββββ Deck A (40%) ββ Deck B (60%) ]
π οΈ Technical Architecture & Implementation Details
- Package Location:
pkg/player/manager.go, pkg/player/deck.go, pkg/player/crossfade.go.
- Mutex Discipline: Enforce strict lock synchronization across both deck goroutines.
- Backend Support: Native Go Oto engine and MPV IPC socket dual-player instance management.
β
Acceptance Criteria (Definition of Done)
π Executive Summary & User Story
As a continuous listener,
I want station changes to execute instantly with a smooth, beat-aware DJ crossfade,
So that I never hear 3β5 seconds of dead silence, audio pops, or buffering lag when surfing stations.
π― Problem Statement & Community Context
In every existing command-line radio player, switching stations stops the current stream, creates an awkward 3β5 second silence while establishing a new TCP connection and buffering audio, and then abruptly starts the new stream.
ποΈ Detailed Functional Requirements
1. Dual-Deck Audio Engine Architecture
pkg/player/to maintain two independent playback decks:Deck AandDeck B.Deck Ais playing live to audio output, selecting a new station assigns it toDeck B.2. Zero-Gap Pre-Buffering & Crossfading
n,p, or selects a station withEnter:Deck Bconnects to the new stream URL and pre-buffers 1.5 seconds of audio in the background.Deck Acontinues playing without interruption.Deck Bis ready,halpradioinitiates a smooth equal-power crossfade (configurable duration:1.0sβ5.0s, default2.5s).Deck Avolume scales1.0 -> 0.0whileDeck Bvolume scales0.0 -> 1.0.Deck Aterminates its network connection and releases resources.3. Visual DJ Deck Transition Indicator
[A βΊ B]crossfade meter) in the playerbar during transitions.π₯οΈ TUI & Visual Design
π οΈ Technical Architecture & Implementation Details
pkg/player/manager.go,pkg/player/deck.go,pkg/player/crossfade.go.β Acceptance Criteria (Definition of Done)
config.yaml.