Count the clicks in a quiet stretch of sound
0:20CC-BY-SA-4.0 · Taco fleur
Proof frames
Tool calls
audio_onsets
Arguments
{
"source": "$CLIP",
"start_sec": 0,
"end_sec": 20,
"min_strength": 0.36,
"band_hz": [
1000,
4000
]
}
Result
{
"ok": true,
"data": {
"source_path": "~/work/cards/clicks-sports/clip.mp4",
"start_sec": 0,
"end_sec": 20,
"sample_rate": 48000,
"hop_samples": 256,
"time_resolution_ms": 5.333,
"min_strength": 0.36,
"band_hz": {
"name": null,
"low_hz": 1000,
"high_hz": 4000
},
"compare_to": null,
"compare_min_delta_db": null,
"onsets": [
{
"time_sec": 1.765333,
"strength": 0.444205,
"band_db": {
"sub": -48.353,
"low_mid": -30.911,
"mid": -31.695,
"high": -52.93,
"air": -54.212
},
"band_energy_db": -4.523
},
{
"time_sec": 3.509333,
"strength": 0.496425,
"band_db": {
"sub": -40.579,
"low_mid": -26.21,
"mid": -22.894,
"high": -35.028,
"air": -35.336
},
"band_energy_db": 5.982
},
{
"time_sec": 5.461333,
"strength": 0.376344,
"band_db": {
"sub": -48.056,
"low_mid": -28.943,
"mid": -26.92,
"high": -45.585,
"air": -47.948
},
"band_energy_db": -7.542
},
{
"time_sec": 6.485333,
"strength": 0.511777,
"band_db": {
"sub": -52.764,
"low_mid": -27.092,
"mid": -27.935,
"high": -47.6,
"air": -47.083
},
"band_energy_db": -1.832
},
{
"time_sec": 10.122667,
"strength": 0.489562,
"band_db": {
"sub": -43.167,
"low_mid": -33.154,
"mid": -24.253,
"high": -36.023,
"air": -41.141
},
"band_energy_db": 6.618
},
{
"time_sec": 11.696,
"strength": 0.47908,
"band_db": {
"sub": -49.006,
"low_mid": -33.194,
"mid": -27.187,
"high": -39.345,
"air": -42.801
},
"band_energy_db": 3.502
}
],
"total": 6,
"merged_count": 2
}
}
Question and answer
- Question
- How many clicks are there in this video's sound, and when do they happen?
- Answer
- The tool reports 6 sound onsets, at 1.77, 3.51, 5.46, 6.49, 10.12, 11.70 s, in the first 20 seconds, in the 1000 to 4000 Hz band.
- Tool returned
- [1.765333,3.509333,5.461333,6.485333,10.122667,11.696]
- Truth
- [1.741,3.509,5.435,6.46,8.318,10.123,11.696]
Check failedprecision 1.00 (min 1), recall 0.86 (min 1), tolerance 0.05s
How it was checked
- Truth from
- constructed
- Fixed at
Planted by this recipe before any tool ran: ffmpeg cut the quietest 20 s of the source's sound (the run of 10 consecutive 2 s steps with the lowest mean level, from 48 s, mean -28.25 dB), and mixed 7 clicks over it: 10 ms full-scale 1 kHz square waves at 1.741, 3.509, 5.435, 6.460, 8.318, 10.123, 11.696 s of the clip. The truth is these planted click times; the tolerance 0.05 s is the match window for the tool's onset times.
A script mixed 7 clicks into the quietest 20 seconds of this clip's own sound, at times it chose, so the truth is those set times. The tool reports onsets, not clicks, and the card does not show the rest of the clip.
Try it yourself
Using agentic-video, find the sharp clicks in the sound of my video. Call audio_onsets on the first 20 seconds of my file with band_hz 1000 to 4000 and min_strength 0.36, then list the time of each onset it reports, in seconds. Use my own file.
- Get the .mcpb file and open it in Claude Desktop.
- Or:
pip install agentic-video
Clip and licence
- Licence
- CC-BY-SA-4.0
- Author
- Taco fleur
- Source
- commons.wikimedia.org
This file is licensed under the Creative Commons Attribution-Share Alike 4.0 International license.