Tools for agents: FFmpeg WAV resampler

Convert PCM WAV audio into a chosen sample rate and channel count. Receive an actual WAV artifact and SHA-256 checksum.

Connect with MCP

{
  "mcpServers": {
    "super-agent-tools": {
      "url": "https://app.getsupers.com/sites/agent-audio-resample/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 resample_wav

Submit plain base64 for an uncompressed integer PCM WAV, mono or stereo, 8/16/24/32-bit. Output is 16-bit PCM WAV at 8, 16, 24 or 48 kHz, mono or stereo. Decode audio_base64 to save the output .wav file. The example is a 10 ms silent fixture. Public execution budget: 524288 decoded input bytes, 15 seconds of audio, 10 seconds processing time. No remote URLs or filesystem paths are accepted. Uploaded metadata is discarded; audio is processed through anonymous pipes and not persisted. Resampling can alter sample values and is not loudness normalization.

Input and output schemas
{
  "name": "resample_wav",
  "title": "FFmpeg WAV resampler",
  "description": "Execute FFmpeg to resample a base64 PCM WAV and return a complete 16-bit PCM WAV artifact plus checksum and actual audio metadata. No URLs, paths or shell commands accepted.",
  "inputSchema": {
    "properties": {
      "audio_base64": {
        "title": "Audio Base64",
        "type": "string"
      },
      "sample_rate": {
        "default": 16000,
        "enum": [
          8000,
          16000,
          24000,
          48000
        ],
        "title": "Sample Rate",
        "type": "integer"
      },
      "channels": {
        "default": 1,
        "enum": [
          1,
          2
        ],
        "title": "Channels",
        "type": "integer"
      }
    },
    "required": [
      "audio_base64"
    ],
    "title": "resample_wavArguments",
    "type": "object"
  },
  "outputSchema": {
    "properties": {
      "mime_type": {
        "title": "Mime Type",
        "type": "string"
      },
      "audio_base64": {
        "title": "Audio Base64",
        "type": "string"
      },
      "sha256": {
        "title": "Sha256",
        "type": "string"
      },
      "sample_rate": {
        "title": "Sample Rate",
        "type": "integer"
      },
      "channels": {
        "title": "Channels",
        "type": "integer"
      },
      "sample_width_bytes": {
        "title": "Sample Width Bytes",
        "type": "integer"
      },
      "frames": {
        "title": "Frames",
        "type": "integer"
      },
      "duration_seconds": {
        "title": "Duration Seconds",
        "type": "number"
      },
      "input_sample_rate": {
        "title": "Input Sample Rate",
        "type": "integer"
      },
      "input_channels": {
        "title": "Input Channels",
        "type": "integer"
      },
      "input_frames": {
        "title": "Input Frames",
        "type": "integer"
      }
    },
    "required": [
      "mime_type",
      "audio_base64",
      "sha256",
      "sample_rate",
      "channels",
      "sample_width_bytes",
      "frames",
      "duration_seconds",
      "input_sample_rate",
      "input_channels",
      "input_frames"
    ],
    "title": "AudioResult",
    "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-audio-resample/call
Content-Type: application/json

{
  "audio_base64": "UklGRsQAAABXQVZFZm10IBAAAAABAAEAQB8AAIA+AAACABAAZGF0YaAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA",
  "sample_rate": 16000,
  "channels": 1
}

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.

Sample rate and channel count determine PCM payload geometry

Read the explanation

The saved resampler page documents base64 PCM WAV input and a requested output sample rate and channel count. Decoding its example locally gives eighty frames at eight thousand frames per second, one channel and two bytes per sample. Eighty divided by eight thousand is zero point zero one seconds, and eighty times one times two gives one hundred sixty PCM payload bytes. At one pixel per frame or byte, those comparison bars measure eighty and one hundred sixty. The WAV container includes headers in addition to that payload. This local inspection establishes the input fixture metadata, not successful execution of the remote resampling service. For the same ten-millisecond duration, an ideal sixteen-thousand-rate output has one hundred sixty frames, and forty-eight-thousand-rate output four hundred eighty. At half a pixel per frame those bars measure eighty and two hundred forty. Increasing rate changes the sampling grid while preserving nominal duration; it does not recover information absent from the original signal. The documented output always uses sixteen-bit PCM, or two bytes per channel sample. Mono at sixteen thousand frames per second needs thirty two thousand payload bytes per second; stereo needs sixty four thousand. Actual service frame counts and duration must be read from the returned artifact rather than assumed from this arithmetic. The saved schema offers four rates: eight, sixteen, twenty four and forty eight kilohertz, and one or two channels. It documents a decoded input limit five hundred twenty four thousand two hundred eighty eight bytes and fifteen seconds of audio. At eight kilohertz mono sixteen-bit, fifteen seconds of PCM payload is two hundred forty thousand bytes. At forty eight kilohertz stereo it is two million eight hundred eighty thousand, exceeding the byte limit before adding headers. At one pixel per ten thousand bytes, those bars measure twenty four and two hundred eighty eight, while the configured limit measures about fifty two point four three. Input byte size and duration are separate constraints. In this offline preview the shared app script is absent, so editable arguments and static schemas do not prove a run result, checksum or service request.

Audio Resampling & PCM Pipe Architecture

How does this tool sanitize, transcode, and validate PCM WAV audio using anonymous FFmpeg pipes without file persistence?

This service exposes a stateless execution boundary for agents requiring audio normalization. When invoked, it unpacks base64 data into memory, verifies uncompressed integer PCM headers, and strips incoming container tags. It then streams raw PCM frames directly into an anonymous FFmpeg pipe with fixed audio options (-ar, -ac, and -c:a pcm_s16le). The output raw PCM stream is repacked into a valid canonical WAV container, hashed via SHA-256, and returned as a structured base64 payload alongside input/output frame counts and duration metrics.

The public sandbox imposes strict limits: inputs must be valid uncompressed integer PCM WAV files under 524,288 bytes, durations must not exceed 15 seconds, and FFmpeg processing times out after 10 seconds. Resampling interpolates sample amplitudes onto a new sampling grid but does not perform dynamic range compression or loudness normalization.

Try a worked example

Click 'Run tool' with the default 10 ms silent fixture (8000 Hz, 1-channel, 80 input frames). The status updates to 'Executed resample_wav in … ms', and the structured result displays an output artifact with sample_rate 16000, channels 1, 160 frames, duration_seconds 0.01, and sample_width_bytes 2.

FFmpeg Pipe Streaming and Filtering

Rather than allowing arbitrary file paths or network endpoints, the backend strictly relies on standard input and output pipes (-protocol_whitelist pipe with pipe:0 and pipe:1). FFmpeg decodes the piped WAV stream, applies sampling rate conversion (-ar) and channel mapping (-ac), and outputs raw uncompressed signed 16-bit little-endian audio (-c:a pcm_s16le -f s16le). ffmpeg Documentation

Options such as -nostdin, -threads 1, and -filter_threads 1 prevent unexpected shell suspension or thread competition within containerized agent execution environments. ffmpeg Documentation

Container Sanitization and Frame Accounting

Before invoking FFmpeg, Python's wave module verifies the declared frame length, channel count (mono or stereo), and integer bit depth (8, 16, 24, or 32-bit). Any proprietary chunks or metadata tags in the incoming WAV container are omitted; only raw audio samples are passed to the transcoder. After transcoding, the byte stream length is validated to ensure complete frame boundaries before building the final WAV header.

Sources and further reading