Skip to content

v0.3.2 - Hi-Res Audio Format Negotiation Fix

Choose a tag to compare

@harperreed harperreed released this 26 Oct 19:59
· 276 commits to main since this release

🔧 Critical Hi-Res Fix

Fixed critical bug that blocked hi-res audio by hardcoding 48kHz/16-bit as the auto-start format.

The Bug

Before: Auto-start used .dropFirst(4).first which:

  • Skipped formats 0-3: 192k/24, 176.4k/24, 96k/24, 88.2k/24
  • Always used format 4: 48k/16 (hardcoded!)
  • Server could never negotiate hi-res formats

After: Auto-start now uses .first which:

  • Uses format 0: 192k/24 (highest priority)
  • Server can negotiate down if needed
  • Properly supports hi-res audio path

Format Priority Order

Auto-start now respects the advertised priority:

  1. 192 kHz / 24-bit PCM (hi-res)
  2. 176.4 kHz / 24-bit PCM (hi-res)
  3. 96 kHz / 24-bit PCM (hi-res)
  4. 88.2 kHz / 24-bit PCM (hi-res)
  5. 48 kHz / 16-bit PCM (fallback)
  6. 44.1 kHz / 16-bit PCM (fallback)

What's Fixed

  • ✅ Hi-res format negotiation now works
  • ✅ Auto-start uses highest advertised format
  • ✅ Server can properly negotiate 192k/176.4k/96k/88.2k @ 24-bit
  • ✅ 24-bit PCM unpacking already implemented and working

Impact

Audio Quality: Client can now receive and play true hi-res audio (up to 192kHz/24-bit) instead of being limited to 48kHz/16-bit.

Files Changed

  • Sources/ResonateKit/Client/ResonateClient.swift:671: Changed .dropFirst(4).first → .first

Credit

Issue identified through thorough audit feedback.

Related

  • v0.3.1: FLAC decoder fix
  • v0.3.0: Initial Opus/FLAC support