How baqir-cs/audiosync works
Audio Sync TV is an Android TV live-audio player whose central workflow is to load an M3U playlist, choose a commentary stream, and adjust its delay from a phone dashboard hosted on the TV. The foreground service coordinates playback and the local HTTP server; the player maintains the in-memory delay while playlist and last-stream data persist. The repository also includes a TV overlay/remote-control path and a separate license administration backend. The README documents the dashboard and API; its web asset is not present in the supplied tree, so it is represented by the server route rather than a source node.
Main entry points: KtorHttpServer.kt Local HTTP server · AudioSyncService.kt Audio service · ExoPlayerController.kt Playback and delay · FloatingHudService.kt Floating HUD
Components 22
TV app and playback
- TV entry screen
app/src/main/java/com/audiosync/tv/MainActivity.kt - Audio service
app/src/main/java/com/audiosync/tv/service/AudioSyncService.kt - Playback and delay
app/src/main/java/com/audiosync/tv/player/ExoPlayerController.kt - Delay processor
app/src/main/java/com/audiosync/tv/player/DelayLineAudioProcessor.kt
Dashboard and playlists
- Local HTTP server
app/src/main/java/com/audiosync/tv/server/KtorHttpServer.kt - Playlist persistence
app/src/main/java/com/audiosync/tv/data/PlaylistRepository.kt - M3U parser
app/src/main/java/com/audiosync/tv/data/M3UParser.kt - Channel state
app/src/main/java/com/audiosync/tv/data/ChannelRepository.kt - Phone dashboard
app/src/main/java/com/audiosync/tv/server/KtorHttpServer.kt
TV overlay controls
- Floating HUD
app/src/main/java/com/audiosync/tv/service/FloatingHudService.kt - TV key handler
app/src/main/java/com/audiosync/tv/service/TvKeyAccessibilityService.kt
License services
- License manager
app/src/main/java/com/audiosync/tv/license/LicenseManager.kt - License cryptography
app/src/main/java/com/audiosync/tv/license/CryptoLicenseUtils.kt - License API
backend/server.js
Sports data engine
- Matches engine
backend/matches_engine.js
Other components
- Phone user
- IPTV video
- Audio stream
- M3U source
- License cloud
- License administrator
- Sports data sources
Connections 21
- Phone user → Phone dashboard: opens
- TV entry screen → Audio service: starts
- TV entry screen → Phone dashboard: shows QR for
- Phone dashboard → Local HTTP server: sends API requests
- Local HTTP server → Audio service: dispatches controls
- Local HTTP server → M3U parser: parses playlist
- Local HTTP server → Playlist persistence: loads and saves
- Local HTTP server → Channel state: updates channels
- Audio service → Playlist persistence: loads saved streams
- Audio service → Playback and delay: controls playback
- Playback and delay → Audio stream: plays stream
- Playback and delay → Delay processor: processes delayed audio
- IPTV video → Phone user: is aligned with
- M3U source → Local HTTP server: provides playlist URL
- TV key handler → Floating HUD: toggles HUD
- Floating HUD → Audio service: dispatches stream and delay controls
- Floating HUD → License manager: observes license state
- License manager → License cryptography: verifies device and signature
- License manager → License API: syncs license status
- License administrator → License API: manages licenses
- Matches engine → Sports data sources: scrapes and integrates