Skip to content

Comments

Add test for AudioSegmentProcessor long segment splitting#66

Open
ysdede wants to merge 2 commits intostagingfrom
testing-improvement-audiosegmentprocessor-4745565586748818318
Open

Add test for AudioSegmentProcessor long segment splitting#66
ysdede wants to merge 2 commits intostagingfrom
testing-improvement-audiosegmentprocessor-4745565586748818318

Conversation

@ysdede
Copy link
Owner

@ysdede ysdede commented Feb 7, 2026

🎯 What:
Added a new test case to src/lib/audio/AudioSegmentProcessor.test.ts to verify the "Proactive Segment Splitting" logic in AudioSegmentProcessor.

📊 Coverage:
The test simulates a continuous high-energy audio stream exceeding the configured maxSegmentDuration (0.5s for the test) and asserts:

  1. A segment is emitted at the expected duration.
  2. The processor transitions correctly to a new speech segment without dropping state.
  3. Timestamps (startTime, endTime) are consistent.

Result:
Improved test coverage ensures that long utterances are split correctly, preventing potential latency or memory issues in the VAD pipeline.


PR created automatically by Jules for task 4745565586748818318 started by @ysdede

- Add unit test to verify that `AudioSegmentProcessor` correctly splits long speech segments that exceed `maxSegmentDuration`.
- Ensure speech state is maintained and new segment is started immediately after splitting.

This addresses the "Verify Long Segment Splitting" task.

Co-authored-by: google-labs-jules[bot] <161369871+google-labs-jules[bot]@users.noreply.github.com>
@ysdede ysdede changed the base branch from release/r1 to staging February 10, 2026 20:59
@ysdede
Copy link
Owner Author

ysdede commented Feb 10, 2026

Review Summary (Post r1→master merge)

Status: ✅ MERGEABLE

Changes: Adds a focused test for AudioSegmentProcessor long segment splitting behavior. Tests that segments exceeding maxSegmentDuration are proactively split while maintaining speech state.

Assessment: Good targeted test. Validates the proactive splitting logic which is important for the v4 pipeline. The test configures a short max duration (500ms) and verifies:

  • Split triggers at the right time
  • Segment duration is bounded
  • Processor remains in speech state after split

Note: PR #69 also adds tests for AudioSegmentProcessor (more comprehensive). Check for overlap — #69 likely supersedes this. If both merge, ensure no duplicate test names.

Recommendation:Merge (but merge #69 after and check for conflicts/overlap)

@google-labs-jules
Copy link
Contributor

Review Summary (Post r1→master merge)

Status: ✅ MERGEABLE

Changes: Adds a focused test for AudioSegmentProcessor long segment splitting behavior. Tests that segments exceeding maxSegmentDuration are proactively split while maintaining speech state.

Assessment: Good targeted test. Validates the proactive splitting logic which is important for the v4 pipeline. The test configures a short max duration (500ms) and verifies:

  • Split triggers at the right time
  • Segment duration is bounded
  • Processor remains in speech state after split

Note: PR #69 also adds tests for AudioSegmentProcessor (more comprehensive). Check for overlap — #69 likely supersedes this. If both merge, ensure no duplicate test names.

Recommendation:Merge (but merge #69 after and check for conflicts/overlap)

Thank you for the review. I acknowledge the note about potential overlap with PR #69.

Renamed `should split long segments proactively` to `should proactively split segments exceeding maxDuration` to avoid potential naming conflicts with other PRs and improve clarity.

Co-authored-by: google-labs-jules[bot] <161369871+google-labs-jules[bot]@users.noreply.github.com>
@ysdede ysdede changed the title 🧪 Add test for AudioSegmentProcessor long segment splitting Add test for AudioSegmentProcessor long segment splitting Feb 12, 2026
Repository owner deleted a comment from google-labs-jules bot Feb 17, 2026
Repository owner deleted a comment from coderabbitai bot Feb 17, 2026
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