Skip to content

feat: add TurnController#13

Merged
wavekat-eason merged 5 commits intomainfrom
feat/turn-controller
Mar 31, 2026
Merged

feat: add TurnController#13
wavekat-eason merged 5 commits intomainfrom
feat/turn-controller

Conversation

@wavekat-eason
Copy link
Copy Markdown
Contributor

Summary

  • Add TurnController<T> wrapper around AudioTurnDetector that tracks prediction state and provides reset_if_finished() for correct VAD integration
  • Calling reset() unconditionally on every VAD speech-start discards audio context when the user pauses mid-sentence. TurnController fixes this by only resetting when the last prediction was Finished
  • Update trait docs, README quick-start, and plan docs to recommend TurnController as the primary API

Test plan

  • 7 unit tests with mock detector covering soft reset, hard reset, state tracking, and buffer accumulation
  • Example using real WAV fixtures (speech_mid.wav → Unfinished → soft reset skips → speech_finished.wav → Finished)
  • make ci passes (all feature flag combinations)

🤖 Generated with Claude Code

wavekat-eason and others added 5 commits March 31, 2026 14:46
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@wavekat-eason wavekat-eason merged commit 612b17f into main Mar 31, 2026
5 checks passed
@wavekat-eason wavekat-eason deleted the feat/turn-controller branch March 31, 2026 01:59
@github-actions github-actions bot mentioned this pull request Mar 31, 2026
wavekat-eason pushed a commit that referenced this pull request Mar 31, 2026
## 🤖 New release

* `wavekat-turn`: 0.0.5 -> 0.0.6 (✓ API compatible changes)

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

<blockquote>

##
[0.0.6](v0.0.5...v0.0.6)
- 2026-03-31

### Added

- expose audio_duration_ms in TurnPrediction
([#15](#15))
- add TurnController
([#13](#13))
</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