Skip to content

feat: add AudioFrame::resample#18

Merged
wavekat-eason merged 1 commit intomainfrom
feat/resample
Apr 17, 2026
Merged

feat: add AudioFrame::resample#18
wavekat-eason merged 1 commit intomainfrom
feat/resample

Conversation

@wavekat-eason
Copy link
Copy Markdown
Contributor

Summary

  • Add AudioFrame::resample(target_rate) behind an optional resample feature flag, backed by rubato 2.0 (sinc interpolation)
  • No-op fast path when already at target rate; returns CoreError::Audio on failure
  • Design doc at docs/03-resample.md; updated CLAUDE.md design principles to reflect feature-gated deps model

Test plan

  • No-op when same sample rate
  • Empty frame returns empty at target rate
  • Downsample 48 kHz → 16 kHz produces correct frame count
  • Upsample 16 kHz → 24 kHz produces correct frame count
  • 440 Hz sine survives resample (zero-crossing frequency check)
  • Doc-test compiles and runs
  • cargo llvm-cov — 98.19% line coverage, 0 uncovered library lines

🤖 Generated with Claude Code

Adds high-quality sinc resampling (rubato 2.0) to AudioFrame, gated
behind an optional `resample` feature flag. Includes design doc, tests,
and updated CLAUDE.md design principles.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@codecov
Copy link
Copy Markdown

codecov bot commented Apr 17, 2026

Codecov Report

❌ Patch coverage is 97.59036% with 2 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
crates/wavekat-core/src/audio.rs 97.59% 2 Missing ⚠️

📢 Thoughts on this report? Let us know!

@wavekat-eason wavekat-eason merged commit b1c6c7f into main Apr 17, 2026
3 checks passed
@wavekat-eason wavekat-eason deleted the feat/resample branch April 17, 2026 10:26
@github-actions github-actions bot mentioned this pull request Apr 17, 2026
wavekat-eason pushed a commit that referenced this pull request Apr 17, 2026
## 🤖 New release

* `wavekat-core`: 0.0.7 -> 0.0.8 (✓ API compatible changes)

<details><summary><i><b>Changelog</b></i></summary><p>

<blockquote>

##
[0.0.8](v0.0.7...v0.0.8)
- 2026-04-17

### Added

- add AudioFrame::resample
([#18](#18))

### Other

- add resample feature to README
([#20](#20))
</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>
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.

1 participant