Skip to content

feat: add AudioFrame::from_vec#9

Merged
wavekat-eason merged 1 commit intomainfrom
feat/audio-frame-from-vec
Apr 6, 2026
Merged

feat: add AudioFrame::from_vec#9
wavekat-eason merged 1 commit intomainfrom
feat/audio-frame-from-vec

Conversation

@wavekat-eason
Copy link
Copy Markdown
Contributor

@wavekat-eason wavekat-eason commented Apr 6, 2026

Summary

  • Adds AudioFrame::from_vec(Vec<f32>, u32) -> AudioFrame<'static> — zero-copy construction for audio producers (TTS, ASR) that own their data
  • Complements the existing new() (borrow path): new() for consumers, from_vec() for producers
  • Eliminates the borrow-then-clone workaround (AudioFrame::new(slice, rate).into_owned()) currently used in wavekat-tts

Test plan

  • from_vec_is_zero_copy unit test verifies the pointer is unchanged (no reallocation)
  • Doc-test in the method's rustdoc
  • cargo test passes (6/6 tests, 3/3 doc-tests)

🤖 Generated with Claude Code

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@wavekat-eason wavekat-eason merged commit c9d98ea into main Apr 6, 2026
1 check passed
@wavekat-eason wavekat-eason deleted the feat/audio-frame-from-vec branch April 6, 2026 20:48
@github-actions github-actions bot mentioned this pull request Apr 6, 2026
wavekat-eason pushed a commit that referenced this pull request Apr 6, 2026
## 🤖 New release

* `wavekat-core`: 0.0.3 -> 0.0.4 (✓ API compatible changes)

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

<blockquote>

##
[0.0.4](v0.0.3...v0.0.4)
- 2026-04-06

### Added

- add AudioFrame::from_vec
([#9](#9))
</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