Search and playback
Audio starts in about 1.5 seconds for YouTube and 200 to 400 ms for a cached or SoundCloud stream.
Starting a song
Playback starts when the first chunk arrives. A cached or SoundCloud song usually starts in 200 to 400 ms; a YouTube song starts in about 1.5 seconds. HLS segments download in parallel and decode in order. Hovering over a song for a moment starts its download.
YouTube streams are resolved with yt-dlp, and simultaneous requests for the same stream share one resolution. yt-dlp only updates after errors that suggest its extractor is out of date, at most once every six hours.
The audio path
A decoder thread writes stereo frames into sample_ring, and the audio callback reads from it without waiting. Decoders for AAC and MP3 are in src/audio/decoders/, and Media Foundation handles other formats.
Search
Search shows results from your own library first and queries YouTube Music, SoundCloud and Spotify in parallel. It returns artists, songs and playlists. A newer query cancels an older one.
Pasting a song link from Spotify, YouTube, SoundCloud, Deezer or Apple Music shows that song, and a playlist link lists its songs.
Networking
All requests use one WinHTTP session with HTTP/2 and connection reuse. Requiem fetches the SoundCloud client ID at startup.