Skip to content

feat: add energy analysis for pacing#4

Open
himax12 wants to merge 3 commits intomainfrom
p1-add-energy-analysis
Open

feat: add energy analysis for pacing#4
himax12 wants to merge 3 commits intomainfrom
p1-add-energy-analysis

Conversation

@himax12
Copy link
Copy Markdown
Owner

@himax12 himax12 commented Apr 9, 2026

Summary

  • Add EnergyAnalyzer class for speech pacing
  • Word rate calculation (words/second)
  • Pause pattern analysis
  • Energy level classification (low/medium/high)
  • Enables pacing-aware B-roll matching

Files Changed

  • backend/core/energy_analyzer.py (new)
  • backend/core/audio_sensor_vertex.py

Copilot AI review requested due to automatic review settings April 9, 2026 06:31
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Adds pacing/“energy” metadata to audio semantic segments to support downstream pacing-aware decisions (e.g., B-roll matching) in the backend audio pipeline.

Changes:

  • Introduces a new energy analysis module that computes word rate, pause stats, and classifies segments as low/medium/high energy.
  • Enriches Vertex AI semantic + fallback segmentation outputs with energy_level, word_rate, and pause_count.
  • Adds two root-level text files that appear to be branch/placeholder markers.

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 4 comments.

File Description
segmentation.txt Adds a one-line branch marker (appears unrelated to feature).
energy-analysis.txt Adds a one-line branch marker (appears unrelated to feature).
backend/core/energy_analyzer.py New helper functions to compute word rate/pause metrics and tag segments with energy metadata.
backend/core/audio_sensor_vertex.py Integrates energy enrichment into both LLM-driven and fallback segmentation paths.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@@ -0,0 +1 @@
Segmentation branch
Copy link

Copilot AI Apr 9, 2026

Choose a reason for hiding this comment

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

This file looks like an accidental branch marker / placeholder and doesn’t appear related to the energy analysis feature. Consider removing it from the PR (or moving any intended documentation into README/DEPLOYMENT docs).

Copilot uses AI. Check for mistakes.
@@ -0,0 +1 @@
Energy Analysis branch
Copy link

Copilot AI Apr 9, 2026

Choose a reason for hiding this comment

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

This file looks like an accidental branch marker / placeholder and doesn’t appear related to the energy analysis feature. Consider removing it from the PR (or moving any intended documentation into README/DEPLOYMENT docs).

Copilot uses AI. Check for mistakes.
Comment on lines +1 to +4
"""
Energy Analyzer - Pacing Analysis for Audio Segments
Analyzes word rate, pauses, and energy levels for B-roll matching
"""
Copy link

Copilot AI Apr 9, 2026

Choose a reason for hiding this comment

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

PR description mentions adding an EnergyAnalyzer class, but this module currently only adds standalone functions. Either introduce the class as described, or update the PR description/module docs to match the actual API to avoid confusing downstream users.

Copilot uses AI. Check for mistakes.
Comment on lines +271 to +273
if final_segments:
final_segments = enrich_segments_with_energy(final_segments, word_segments)

Copy link

Copilot AI Apr 9, 2026

Choose a reason for hiding this comment

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

create_semantic_segments() (and _fallback_segmentation()) now enrich segments with energy_level, word_rate, and pause_count, but the method docstring still states it returns only text, start, end, and duration. Please update the docstring (and any callers’ expectations, if documented elsewhere) to reflect the expanded segment schema.

Copilot uses AI. Check for mistakes.
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.

2 participants