Skip to content

Add duration to utterance_start message - #146

Open
femelo wants to merge 4 commits into
OpenVoiceOS:devfrom
femelo:add-audio-duration
Open

Add duration to utterance_start message#146
femelo wants to merge 4 commits into
OpenVoiceOS:devfrom
femelo:add-audio-duration

Conversation

@femelo

@femelo femelo commented Jan 27, 2026

Copy link
Copy Markdown

Add duration to utterance_start message

Summary by CodeRabbit

  • New Features
    • Audio duration is now automatically calculated and included in recognizer events when utterance recognition begins, supplying timing metadata for audio workflows and analytics. If duration lookup fails, processing continues without the duration and a warning is logged.

✏️ Tip: You can customize this high-level summary in your review settings.

@coderabbitai

coderabbitai Bot commented Jan 27, 2026

Copy link
Copy Markdown
Contributor

Warning

Review limit reached

@JarbasAl, you've reached your PR review limit, so we couldn't start this review.

Next review available in: 52 minutes

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

How can I continue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews.

How do review limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window.

Please refer docs for additional details.

Review details
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: 04ea22b8-bd3b-4da9-8b3b-93e26dc36d04

📥 Commits

Reviewing files that changed from the base of the PR and between 7ba4482 and 576639b.

📒 Files selected for processing (1)
  • ovos_audio/playback.py
📝 Walkthrough

Walkthrough

Imports a sound-duration helper and computes the duration of each played audio (stripping a file:// prefix) in ovos_audio/playback.py, then attaches that duration as message.data["duration"] before emitting the recognizer_loop:utterance_start event.

Changes

Cohort / File(s) Summary
Audio duration injection
ovos_audio/playback.py
Add get_sound_duration import; compute duration from audio path (remove file:// prefix if present) and set message.data["duration"] before emitting recognizer_loop:utterance_start (logs a warning if duration retrieval fails).

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Poem

🐰 I hop through bytes and song,
I count each beat, I hum along,
A little number tucked inside,
A rhythm kept for every stride,
Quietly added — soft and spry.

🚥 Pre-merge checks | ✅ 2 | ❌ 1
❌ Failed checks (1 warning)
Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (2 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly and concisely summarizes the main change: adding a duration field to the utterance_start message.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing touches
  • 📝 Generate docstrings

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@codecov-commenter

codecov-commenter commented Jan 27, 2026

Copy link
Copy Markdown

⚠️ Please install the 'codecov app svg image' to ensure uploads and comments are reliably processed by Codecov.

Codecov Report

❌ Patch coverage is 0% with 6 lines in your changes missing coverage. Please review.
✅ Project coverage is 0.00%. Comparing base (aaa2d58) to head (7ba4482).
⚠️ Report is 14 commits behind head on dev.

Files with missing lines Patch % Lines
ovos_audio/playback.py 0.00% 6 Missing ⚠️
❗ Your organization needs to install the Codecov GitHub app to enable full functionality.
Additional details and impacted files
@@          Coverage Diff          @@
##             dev    #146   +/-   ##
=====================================
  Coverage   0.00%   0.00%           
=====================================
  Files          8       8           
  Lines       1013    1018    +5     
=====================================
- Misses      1013    1018    +5     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🤖 Fix all issues with AI agents
In `@ovos_audio/playback.py`:
- Around line 134-136: Wrap the call to get_sound_duration in a local try/except
so a failure there doesn't abort playback: catch exceptions around
get_sound_duration(data.replace('file://', '')), set
message.data["duration"]=None on error (or leave unset), optionally log the
exception, and then continue to emit
self.bus.emit(message.forward("recognizer_loop:utterance_start", message.data))
and call play_audio as before; this change should be made inside the _play
method around the get_sound_duration usage to ensure playback proceeds even if
duration computation fails.

Comment thread ovos_audio/playback.py Outdated
@JarbasAl

Copy link
Copy Markdown
Member

@femelo can you please rebase so the new CI bot and tests run?

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.

3 participants