Skip to content

[darwin] extractToWav returns incorrect format info for HE-ACC audio - #225

Merged
hm21 merged 3 commits into
hm21:stablefrom
ekuleshov:wav_export
Oct 3, 2026
Merged

hm21 merged 3 commits into
hm21:stablefrom
ekuleshov:wav_export

Conversation

@ekuleshov

@ekuleshov ekuleshov commented Oct 2, 2026 •

Copy link
Copy Markdown
Contributor

Description

extractToWav returns incorrect format info for HE-ACC audio on MacOS and iOS

Related Issue: Closes #226

Type of Change

  • ✨ New feature (non-breaking change which adds functionality)
  • 🛠️ Bug fix (non-breaking change which fixes an issue)
  • ❌ Breaking change (fix or feature that would cause existing functionality to change)
  • 🧹 Code refactor
  • ✅ Build configuration change
  • 📝 Documentation
  • 🗑️ Chore

hm21 added 2 commits October 3, 2026 09:02
The decoded format was taken while no PCM had been written yet, which tied it to the byte count. A dedicated flag states the intent, and the comments now say why the track's format is only a fallback for HE-AAC (SBR doubles the rate, PS turns mono into stereo).
Adds a 6 KB, 2 s HE-AAC v2 tone (22.05 kHz mono core, 44.1 kHz stereo decoded) and checks the extracted WAV's length and pitch, full and trimmed. Before the fix the header claimed 22.05 kHz mono, so the WAV lasted 8 s instead of 2 s.
@hm21

hm21 commented Oct 3, 2026

Copy link
Copy Markdown
Owner

Thanks a lot for the fix, @ekuleshov! On top of your change we added a regression integration test with a tiny HE-AAC v2 clip (the old code wrote a WAV claiming 8 s for 2 s of audio) and a small cleanup that tracks the decoded format with its own flag. Testing it on Android also turned up an older bug there, trimmed WAV extractions came out short, which is fixed in #228. This ships in 2.22.0.

@hm21
hm21 merged commit 2556f07 into hm21:stable Oct 3, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: extractWav returns incorrect format info on Darwin

2 participants