feat: read G.711 A-law/μ-law WAVs in from_wav#32
Merged
Conversation
Platform-generated phone-ready prompts are stored as G.711 μ-law WAVs (format tag 7), which hound cannot parse — from_wav failed on every frozen flow asset the WaveKat Voice daemon cached. Sniff the fmt chunk and decode format tags 6 (A-law) and 7 (μ-law) through codec::g711, falling through to hound for everything else. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Hj93UCb3RKjF6mBwzhsp9f
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Hj93UCb3RKjF6mBwzhsp9f
Merged
wavekat-eason
pushed a commit
that referenced
this pull request
Jul 18, 2026
## 🤖 New release * `wavekat-core`: 0.0.13 -> 0.0.14 (✓ API compatible changes) <details><summary><i><b>Changelog</b></i></summary><p> <blockquote> ## [0.0.14](v0.0.13...v0.0.14) - 2026-07-18 ### Added - read G.711 A-law/μ-law WAVs in from_wav ([#32](#32)) </blockquote> </p></details> --- This PR was generated with [release-plz](https://github.com/release-plz/release-plz/). Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Why
The WaveKat platform freezes flow prompt audio "phone-ready" as G.711 μ-law WAV (format tag 7).
AudioFrame::from_wavdelegates entirely to hound, which only parses integer and float PCM — so every one of those files failed to decode, and downstream flow playback aborted at the first prompt.What
from_wavnow sniffs the RIFFfmtchunk first: format tags 6 (A-law) and 7 (μ-law) are decoded through the existingcodec::g711module and normalised to f32 like the i16 path; everything else falls through to hound unchanged (including its more descriptive parse errors for non-WAV bytes).fmtchunks (cbSize),factchunks, odd-size chunk padding, and declared sizes that overrun the file.docs/01-wav-io.md) updated.mp3 is deliberately not supported — it would pull a decoder dependency into a zero-dep crate, and the platform only stores mp3 as a browser-preview convenience (telephony formats are always WAV).
Tests
datachunk → descriptive error; non-RIFF bytes still error via hound.cargo test --all-features(76 + 7 doc tests),clippy -D warnings,fmt --checkall clean.🤖 Generated with Claude Code
https://claude.ai/code/session_01Hj93UCb3RKjF6mBwzhsp9f