Skip to main content
Glama

Extract audio to WAV

extract_audio_from_file

Extract an audio stream from a video or media file into an uncompressed WAV for import, analysis, or use in another program, leaving the source unchanged.

Instructions

Write one audio stream of a media file to an uncompressed WAV file, optionally only a time range, with a chosen sample rate, channel count and bit depth. Use it to get the sound of a video as a separate file to import, to send to another program, or to analyse. The source is not changed. Returns the new file's output_path, duration, sample rate, channels and size, plus source_start/source_end. Works on the file on disk with ffmpeg, not on the timeline; Premiere Pro is not needed. ffmpeg and ffprobe must be installed (see check_ffmpeg), else FFMPEG_NOT_FOUND.

Tool call template

Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {
      "path": "<path>",
      "output_path": "<output_path>"
    },
    "name": "extract_audio_from_file"
  }
}

Input Schema

NameRequiredDescriptionDefault
endNoEnd of the part to extract, in file time (seconds); clamped to the file's length. Default: the end of the file.
pathYesAbsolute path of the media file on this computer.
startNoStart of the part to extract, in file time (seconds). Default 0.
channelsNoChannel count of the WAV, 1-8 (1 = mono mix, 2 = stereo). Default: the source's channels.
bit_depthNoBits per sample: 16, 24 or 32 (integer PCM). Default 24.
overwriteNoReplace output_path if it already exists. Default false: an existing file makes the tool fail with FILE_EXISTS.
output_pathYesAbsolute path of the WAV file to write (.wav only); missing folders are created.
sample_rateNoSample rate of the WAV in Hz, 8000-192000. Default: the source's rate.
audio_streamNoWhich audio stream to use, 0-based among the file's audio streams (see probe_media_file). Default 0.
timeout_secondsNoStop ffmpeg and fail with TIMEOUT after this many seconds. Default 900.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv1.0.0

TDQS

A4.3/5.0
Behavior5/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

Goes well beyond the annotations: source file is unchanged, missing folders are created, an existing output_path fails with FILE_EXISTS unless overwrite is set, ffmpeg/ffprobe must be installed else FFMPEG_NOT_FOUND, and a timeout aborts with TIMEOUT. It also enumerates the returned fields since no output schema exists.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Front-loads the operation, then use cases, then side effects, then return values, then environment requirements. Dense but every sentence carries information an agent would otherwise have to discover by trial.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Covers return values, error conditions and the external ffmpeg dependency thoroughly for a 10-parameter mutation tool with no output schema. What it omits is guidance on choosing among audio streams or formats beyond defaults, and there is no named alternative for the timeline-based export case, leaving a routing gap against siblings.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 100%, so parameter meaning is already fully documented in the schema, including defaults, ranges and clamping. The description only restates the dimensions of control (time range, sample rate, channels, bit depth, single stream) without adding new semantics such as format constraints or interactions between them.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

States a specific verb and resource: write one audio stream of a media file to an uncompressed WAV, with optional time range and format settings. It also distinguishes itself from timeline-based audio tools by noting it 'works on the file on disk with ffmpeg, not on the timeline', which separates it from siblings like export_audio_only.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

Gives concrete use cases (import elsewhere, hand to another program, analyse) and a clear scope boundary (file on disk, Premiere Pro not needed), plus a prerequisite pointer to check_ffmpeg. It does not name a specific alternative sibling for the timeline case, so it falls short of explicit when/when-not routing.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Deploy Server

Other Tools