Tools for agents: Frame-exact WAV silence ranges

Locate contiguous low-amplitude PCM audio ranges with exact threshold comparisons and rational time offsets.

Connect with MCP

{
  "mcpServers": {
    "super-agent-tools": {
      "url": "https://app.getsupers.com/sites/agent-wav-silence/mcp"
    }
  }
}
Streamable HTTP · No API key · Stateless

Use this URL in any client supporting remote Streamable HTTP MCP. Calls return structured JSON; inputs are processed without persistence.

Call detect_wav_silence

Accepts plain base64 nonempty mono/stereo integer PCM WAV, 8/16/24/32-bit, within 524288 decoded bytes and 15 seconds. A frame qualifies only when every channel sample satisfies abs(sample)<=threshold*2^(bits-1). threshold is an integer or quoted finite decimal/fraction between 0 and 1; zero detects digital silence, one includes all samples. 8-bit samples are centered by subtracting 128. Comparisons are exact and inclusive, without rounding the threshold. Only maximal contiguous qualifying runs at least minimum_frames long are reported; short runs are omitted, never merged across loud frames. Ranges use zero-based half-open frame offsets and exact rational seconds. threshold_matching_frames includes short omitted runs; reported_frames counts only returned ranges. This is a sample-amplitude rule, not perceptual silence, RMS/LUFS analysis, denoising or voice activity detection. It neither trims nor changes audio and uses no URLs, file paths or persistent storage.

Input and output schemas
{
  "name": "detect_wav_silence",
  "title": "Frame-exact WAV silence ranges",
  "description": "Find contiguous frames whose every channel sample is at or below an exact full-scale amplitude fraction; return qualifying half-open ranges.",
  "inputSchema": {
    "properties": {
      "audio_base64": {
        "title": "Audio Base64",
        "type": "string"
      },
      "threshold": {
        "anyOf": [
          {
            "type": "integer"
          },
          {
            "type": "string"
          }
        ],
        "default": "1/100",
        "title": "Threshold"
      },
      "minimum_frames": {
        "default": 1,
        "title": "Minimum Frames",
        "type": "integer"
      }
    },
    "required": [
      "audio_base64"
    ],
    "title": "detect_wav_silenceArguments",
    "type": "object"
  },
  "outputSchema": {
    "additionalProperties": true,
    "title": "detect_wav_silenceDictOutput",
    "type": "object"
  },
  "icons": null,
  "annotations": {
    "title": null,
    "readOnlyHint": true,
    "destructiveHint": false,
    "idempotentHint": true,
    "openWorldHint": false
  },
  "meta": null,
  "execution": null
}

Run the example to see the actual result.

HTTP alternative

POST https://app.getsupers.com/sites/agent-wav-silence/call
Content-Type: application/json

{
  "audio_base64": "UklGRjQAAABXQVZFZm10IBAAAAABAAEAQB8AAIA+AAACABAAZGF0YRAAAAAAAAAA6AMAAAAAAAAY/AAA",
  "threshold": 0,
  "minimum_frames": 2
}

The HTTP and MCP interfaces execute the same implementation. Validation errors are returned explicitly. See the tool notes above for its supported inputs and behavior.

Exact frame predicates produce maximal silence ranges

Read the explanation

The saved mono fixture has eight frames: zero, zero, one thousand, zero, zero, zero, negative one thousand and zero. Threshold zero matches six exact zero frames and excludes two nonzero frames. At forty pixels per frame total, matching and nonmatching measure three hundred twenty, two hundred forty and eighty. The sample amplitude predicate is inclusive and must hold in every channel. This is not a voice activity detector or perceptual silence measurement. These counts come from locally decoded fixture bytes, not a backend run. With minimum length two, maximal zero runs cover half open ranges zero to two and three to six. The final run seven to eight contains only one frame and is omitted. The two returned lengths are two and three, totaling five reported frames, while threshold matching still counts six. At fifty pixels per frame first run, second run and omitted run measure one hundred, one hundred fifty and fifty. Loud frames are never bridged to merge runs. At eight thousand frames per second the returned durations are one four thousandth and three eight thousandths of a second; the final short run remains separate. Sixteen bit full scale normalization divides by thirty two thousand seven hundred sixty eight. A hypothetical threshold one thirty second sets an exact bound of one thousand twenty four. Magnitudes one thousand, one thousand twenty four and one thousand twenty five measure two hundred fifty, two hundred fifty six and two hundred fifty six point two five at one quarter pixel per unit. The first two qualify inclusively, the third does not. In stereo one loud channel rejects the whole frame. No threshold rounding, trimming or denoising occurs. The saved offline form preserves native argument editing, but its shared application script is absent, so no server ranges or actual tool call are verified.

Exact PCM Audio Silence Detection

How does frame-exact WAV silence detection identify low-amplitude runs, and why does sample thresholding differ from perceptual audio silence?

The detect_wav_silence endpoint scans uncompressed integer PCM audio frames without altering sample data. For each frame across all channels, it verifies whether every sample satisfies |sample| <= threshold * 2^(bits - 1). Adjacent qualifying frames are grouped into maximal contiguous half-open runs [start_frame, end_frame). Only runs reaching or exceeding minimum_frames are reported with rational start and end timestamps in seconds, while shorter qualifying runs are omitted from reported ranges but tracked in threshold_matching_frames.

This endpoint evaluates exact integer peak sample amplitudes against full-scale rail values. It does not measure perceptual acoustic loudness (such as LUFS or EBU R128), compute root-mean-square (RMS) energy, apply spectral noise reduction, or perform statistical voice activity detection (VAD). Floating-point audio formats (IEEE float) and compressed formats are not accepted.

Try a worked example

Click 'Run tool' with the default sample (8 mono 16-bit PCM frames sampled at 8000 Hz, with threshold 0 and minimum_frames 2). The service evaluates 8 frame values: frames 0–1 are 0 (qualifying run of length 2), frame 2 is 1000 (non-qualifying), frames 3–5 are 0 (qualifying run of length 3), frame 6 is -1000 (non-qualifying), and frame 7 is 0 (qualifying run of length 1). Because minimum_frames is 2, the single quiet frame at index 7 is omitted from ranges, yielding range_count 2 ([0, 2) and [3, 6)), reported_frames 5, and threshold_matching_frames 6.

PCM Byte Parsing and Bit-Depth Alignment

The Python wave module parses header parameters including channel count, sample width in bytes, frame rate, and frame count from uncompressed PCM audio files. wave — Read and write WAV files — Python documentation

In this endpoint, 8-bit samples are decoded as unsigned bytes and centered by subtracting 128, whereas 16-bit, 24-bit, and 32-bit samples are parsed as little-endian signed two's-complement integers. The threshold comparison scales against 2^(bits - 1) using exact rational fractions.

Contiguous Run Lengths and Rational Timestamps

A frame qualifies as quiet only when every channel in that frame meets the absolute amplitude inequality. Qualifying frames form continuous half-open runs [start_frame, end_frame). The endpoint computes exact start and end times in seconds as rational fractions (frame_index / sample_rate) rather than approximate floating-point values.

Runs shorter than minimum_frames are excluded from the returned ranges array and reported_frames total, but are still counted in threshold_matching_frames. The tool performs detection only and does not trim, mute, or rewrite the underlying audio bytes.

Sources and further reading