pause-detector
Detect pauses and silence in audio using local dynamic thresholds. Use when you need to find natural pauses in lectures, board-writing silences, or breaks between sections. Uses local median-based context comparison to stay robust during long pauses.
- License 许可
- Apache-2.0
- 最近更新
- 2026-11-14
- Stars
- ★ 0
- Forks
- 1
01 前言 Front Matter
- name
- pause-detector
- description
- Detect pauses and silence in audio using local dynamic thresholds. Use when you need to find natural pauses in lectures, board-writing silences, or breaks between sections. Uses local median-based context comparison to stay robust during long pauses.
02 资源文件 1
- 脚本scripts/detect_pauses.py4.6 KB
03 SKILL.md 正文
Pause Detector
Detects pauses and low-energy segments using a local median dynamic threshold on pre-computed energy data. Unlike mean-based local methods, the median reference is not pulled down by the pause itself, so a long pause stays below the threshold for its entire duration.
Use Cases
- Detecting natural pauses in lectures
- Finding board-writing silences
- Identifying breaks between sections
Usage
python3 /root/.claude/skills/pause-detector/scripts/detect_pauses.py \
--energies /path/to/energies.json \
--output /path/to/pauses.json
Parameters
--energies: Path to energy JSON file (from energy-calculator)--output: Path to output JSON file--start-time: Start analyzing from this second (default: 0). Typically set to the opening end reported bysilence-detector.--threshold-ratio: Fraction of the local median RMS below which a second is counted as silent (default:0.3).--min-duration: Minimum pause duration in seconds, inclusive (default:2). Pauses of exactlymin_durationseconds are kept.--window-size: Width in seconds of the sliding window used for the local median reference (default:60).
Threshold semantics
is_silent[i] = energy[i] < threshold_ratio * median_in_window(i)
- The reference is the median inside a window of
window_sizeseconds centered oni. A long pause does not drag the median down, so the condition stays true for the full pause. - Lower
threshold_ratio⇒ more conservative (only very quiet frames qualify). Higher ⇒ more aggressive. silence-detector's--threshold-multiplierand this detector's--threshold-ratioare not interchangeable numerically: silence-detector multiplies a global baseline, pause-detector takes a fraction of a local reference. Treat them as separate knobs.
Output Format
{
"method": "local_dynamic_threshold_median",
"segments": [
{"start": 610, "end": 613, "duration": 3},
{"start": 720, "end": 724, "duration": 4}
],
"total_segments": 11,
"total_duration_seconds": 28,
"parameters": {
"threshold_ratio": 0.3,
"window_size": 60,
"min_duration": 2,
"start_time": 221,
"local_reference": "median"
}
}
How It Works
- Load pre-computed per-second energies.
- Compute a local median reference with
scipy.ndimage.median_filterover a window ofwindow_sizeseconds. - Mark seconds where
energy < threshold_ratio * local_median. - Group consecutive low-energy seconds into segments.
- Keep segments whose duration is
>= min_duration(inclusive).
Dependencies
- Python 3.11+
- numpy
- scipy
Example
# Detect pauses after opening (start at 221s)
python3 /root/.claude/skills/pause-detector/scripts/detect_pauses.py \
--energies energies.json \
--start-time 221 \
--threshold-ratio 0.3 \
--window-size 60 \
--output pauses.json
Parameters Tuning
| Parameter | Lower Value | Higher Value |
|---|---|---|
threshold_ratio |
More conservative (only very quiet frames) | More aggressive |
min_duration |
Shorter pauses | Longer pauses only |
window_size |
More locally-adaptive | Broader, more stable reference |
Notes
- Requires energy data from energy-calculator skill.
- Use
--start-timeto skip the detected opening fromsilence-detector. - Local median reference adapts to varying speaker volume while remaining robust during long pauses.
- Pauses of exactly
min_durationseconds are preserved; the comparison is inclusive (>=).
04 同仓库更多 Skills
video-frame-extraction
Extract frames from video files and save them as images using OpenCV
openai-vision
Analyze images and multi-frame sequences using OpenAI GPT vision models
image-ocr
Extract text content from images using Tesseract OCR via Python, including structured field extraction from receipts and forms
video-frame-extraction
Extract frames from video files and save them as images using OpenCV
openai-vision
Analyze images and multi-frame sequences using OpenAI GPT vision models
image-ocr
Extract text content from images using Tesseract OCR via Python, including structured field extraction from receipts and forms