Add audio visualizer with spectrogram, beat-reactive art, and device selection
- New audio_analyzer service: loopback capture via soundcard + numpy FFT - Real-time spectrogram bars below album art with accent color gradient - Album art and vinyl pulse to bass energy beats - WebSocket subscriber pattern for opt-in audio data streaming - Audio device selection in Settings tab with auto-detect fallback - Optimized FFT pipeline: vectorized cumsum bin grouping, pre-serialized JSON broadcast - Visualizer config: enabled/fps/bins/device in config.yaml - Optional deps: soundcard + numpy (graceful degradation if missing) Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -628,8 +628,39 @@ h1 {
|
||||
}
|
||||
|
||||
@keyframes vinylSpin {
|
||||
from { transform: rotate(var(--vinyl-offset, 0deg)); }
|
||||
to { transform: rotate(calc(var(--vinyl-offset, 0deg) + 360deg)); }
|
||||
from { transform: rotate(var(--vinyl-offset, 0deg)) scale(var(--vinyl-scale, 1)); }
|
||||
to { transform: rotate(calc(var(--vinyl-offset, 0deg) + 360deg)) scale(var(--vinyl-scale, 1)); }
|
||||
}
|
||||
|
||||
/* Audio Spectrogram Visualization */
|
||||
.spectrogram-canvas {
|
||||
position: absolute;
|
||||
bottom: -4px;
|
||||
left: 50%;
|
||||
transform: translateX(-50%);
|
||||
z-index: 2;
|
||||
pointer-events: none;
|
||||
opacity: 0;
|
||||
transition: opacity 0.3s ease;
|
||||
border-radius: 0 0 8px 8px;
|
||||
}
|
||||
|
||||
.visualizer-active .spectrogram-canvas {
|
||||
opacity: 1;
|
||||
}
|
||||
|
||||
.visualizer-active #album-art {
|
||||
transition: transform 0.08s ease-out;
|
||||
}
|
||||
|
||||
.visualizer-active .album-art-glow {
|
||||
transition: opacity 0.08s ease-out;
|
||||
}
|
||||
|
||||
/* Adapt spectrogram for vinyl mode */
|
||||
.album-art-container.vinyl .spectrogram-canvas {
|
||||
bottom: -10px;
|
||||
border-radius: 0 0 50% 50%;
|
||||
}
|
||||
|
||||
.track-info {
|
||||
@@ -1087,6 +1118,74 @@ button:disabled {
|
||||
margin-bottom: 1rem;
|
||||
}
|
||||
|
||||
.audio-device-selector {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: 0.75rem;
|
||||
}
|
||||
|
||||
.audio-device-selector label {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: 0.375rem;
|
||||
}
|
||||
|
||||
.audio-device-selector label span {
|
||||
font-size: 0.8125rem;
|
||||
font-weight: 500;
|
||||
color: var(--text-secondary);
|
||||
}
|
||||
|
||||
.audio-device-selector select {
|
||||
padding: 0.5rem 0.625rem;
|
||||
border-radius: 8px;
|
||||
border: 1px solid var(--border);
|
||||
background: var(--bg-tertiary);
|
||||
color: var(--text-primary);
|
||||
font-size: 0.875rem;
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
.audio-device-status {
|
||||
font-size: 0.75rem;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 0.375rem;
|
||||
}
|
||||
|
||||
.audio-device-status::before {
|
||||
content: '';
|
||||
display: inline-block;
|
||||
width: 6px;
|
||||
height: 6px;
|
||||
border-radius: 50%;
|
||||
}
|
||||
|
||||
.audio-device-status.active {
|
||||
color: var(--accent);
|
||||
}
|
||||
|
||||
.audio-device-status.active::before {
|
||||
background: var(--accent);
|
||||
}
|
||||
|
||||
.audio-device-status.available {
|
||||
color: var(--text-secondary);
|
||||
}
|
||||
|
||||
.audio-device-status.available::before {
|
||||
background: var(--text-muted);
|
||||
}
|
||||
|
||||
.audio-device-status.unavailable {
|
||||
color: var(--text-muted);
|
||||
}
|
||||
|
||||
.audio-device-status.unavailable::before {
|
||||
background: var(--text-muted);
|
||||
opacity: 0.5;
|
||||
}
|
||||
|
||||
/* Link card in Quick Access */
|
||||
.link-card {
|
||||
text-decoration: none;
|
||||
|
||||
Reference in New Issue
Block a user