Add new "audio" color strip source type with three visualization modes (spectrum analyzer, beat pulse, VU meter) supporting WASAPI loopback and microphone input via PyAudioWPatch. Includes shared audio capture with ref counting, real-time FFT spectrum analysis, and beat detection. Improve all referential integrity 409 error messages across delete endpoints to include specific names of referencing entities instead of generic "one or more" messages. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
19 lines
638 B
Python
19 lines
638 B
Python
"""Audio device routes: enumerate available audio devices."""
|
|
|
|
from fastapi import APIRouter
|
|
|
|
from wled_controller.api.auth import AuthRequired
|
|
from wled_controller.core.audio.audio_capture import AudioCaptureManager
|
|
|
|
router = APIRouter()
|
|
|
|
|
|
@router.get("/api/v1/audio-devices", tags=["Audio"])
|
|
async def list_audio_devices(_auth: AuthRequired):
|
|
"""List available audio input/output devices for audio-reactive sources."""
|
|
try:
|
|
devices = AudioCaptureManager.enumerate_devices()
|
|
return {"devices": devices, "count": len(devices)}
|
|
except Exception as e:
|
|
return {"devices": [], "count": 0, "error": str(e)}
|