Earshot Gives Coding Agents an Open-Source Audio Feedback Loop
Earshot gives coding agents calibrated hearing and a code-based sound forge, running fully on CPU with a CLI, Python API, and MCP server.
Takeaways
- Earshot gives coding agents calibrated hearing: describe, match, find, critique sounds via CLI, Python API, and MCP.
- Runs CPU-only on two open models (CLAP plus AudioSet AST), roughly 1.4 GB, offline after first download.
- Forge command synthesizes sounds from physical-synthesis recipes and improves them via an evolutionary critic loop.
- Validation: 98% kind-of-sound accuracy on strong matches, 0.92 ROC-AUC real vs synthesized, 93% event detection in mixes.
- v0.3 adds 201 code-generated sounds, a kit builder, and frame-accurate SFX placement.
- MIT licensed; limits include no taste, licensing, speech, or above-14 kHz judgments.
Coding agents can write and render product films, game demos, and interface prototypes. Their toolchains rarely reveal whether a key press matches its brief, an impact lands on the intended frame, or a musical swell aligns with a transition. Earshot is an open-source toolkit that lets agents describe, match, locate, critique, and synthesize sounds from code on a CPU.
The v0.3 announcement adds 201 programmatically generated sounds, a kit builder, and tighter frame-accurate sound-effect placement. The MIT-licensed project ships as a command-line interface, Python API, and Model Context Protocol server, which exposes its tools to compatible agents such as Claude Code.
Waveforms become evidence
Earshot converts an audio file into structured observations that an agent can use in later steps. Its outputs cover descriptive tags, text-to-audio similarity, event timing, estimated source realism, audiovisual synchronization, and comparisons with reference films. Every command returns a plain-language assessment and a JSON payload suitable for scripts, tests, and agent tool calls.
Six ways to listen
| Command | Output | Typical use |
|---|---|---|
describe FILE |
Calibrated tags, AudioSet labels, raw measurements, alternatives, and z-scores | Summarize a sound and surface plausible competing interpretations. A z-score measures distance from the calibration baseline in standard deviations. |
match FILE QUERY |
A similarity score and a verdict of strong, plausible, weak, or no match | Check whether a sound fits a written brief. |
find FILE QUERY |
Ranked moments and sample-level trim points | Locate an event inside a longer recording. |
realness FILE |
Per-window estimates of recorded or code-synthesized origin | Flag conspicuously synthetic sections and identify uncertain regions. |
timeline and sheet |
A second-by-second transcript or annotated PNG containing frames, events, a spectrogram, and sync markers | Give text-oriented or vision-capable agents a compact view of a complete mix. |
critique FILE --video V |
Scores and timestamped fixes based on a profile of seven professional launch films | Review loudness, pacing, event placement, and synchronization against the included reference corpus. |
Two open models provide the learned analysis. laion/larger_clap_general creates embeddings, numerical representations that place related text and audio near each other. MIT/ast-finetuned-audioset-10-10-0.4593 predicts events from the AudioSet taxonomy. Their first download uses about 1.4 GB; subsequent analysis can run locally and offline.
Forge searches the sound space
Earshot’s forge subsystem lets an agent define a sound as a synthesis recipe. A recipe can combine modal resonators that approximate vibrating objects, contact excitations, filtered noise, a computed room response, and microphone simulation. The resulting WAV files contain no recorded source samples.
For each generation, Forge renders parameter variations and scores them with Earshot’s critic. The evaluation covers the requested description, specified confusable sounds, resemblance to real references, measured envelope shape, source realism, tonal balance, and decay behavior. Evolutionary search retains higher-scoring candidates, mutates their parameters, and repeats the process. An agent can then inspect the scores and spectrograms, revise the recipe, and launch another search.
A keypress search
earshot forge keypress --refs path/to/real/keypresses/ \
--budget 144 --reps 2 --tone 1.5 --keep 4 --robust 8 \
--dir made/keypress
The CLI exposes controls for the search budget, repetitions, tone weighting, retained candidates, and robustness checks across new random seeds. Reference recordings supply a target distribution for the critic and visual comparisons for later review.
A completed run writes diverse WAV candidates and a report.json file containing every parameter and score. The report also includes held-out AudioSet tags and leave-one-out scores, which score each real reference against the remaining references to provide a practical baseline.
The scores and their limits
The repository reports validation results for matching, realness classification, mixed-audio event detection, runtime, and a small listening test. These figures describe the project’s own evaluation and await independent replication.
| Evaluation | Reported result |
|---|---|
| Strong sound-match verdicts on 125 held-out real recordings | Correct broad sound type in 98% of cases and correct exact variant in 61% |
| Real versus synthesized classification with whole sound families held out | ROC-AUC of 0.92, with roughly 6% to 7% confident errors in each direction and about 20% of clips rated uncertain |
| Event detection in a 60-second finished mix | 93% of placed effects detected, including 89% of quiet effects under music |
| Analysis time on a laptop CPU | About 1.5 minutes for a 60-to-90-second film |
| Author’s blind forged-versus-real test | 8 correct identifications across 15 comparisons |
ROC-AUC measures how well a classifier ranks the two classes across thresholds; 0.5 represents chance ranking and 1.0 represents perfect separation. Holding out complete sound families reduces the chance that closely related variants appear on both sides of the evaluation split.
The 15-comparison listening test is too small to establish perceptual parity between forged and recorded audio. Its useful diagnostic was specific: an impact’s decay ended too quickly, revealing the synthesized candidate.
Where the models lose the signal
- Measured properties: Loudness, timing, synchronization to picture, exposed-sound matching, and detection of conspicuously synthesized sources are the strongest use cases.
- Mixed audio: Event labels inside dense mixes, along with music genre and mood estimates, remain provisional.
- Human judgments: The toolkit does not evaluate taste, narrative intent, emotional effect, provenance, licensing, or speech content.
- Frequency range: The analysis models do not capture content above roughly 14 kHz.
- Critique scope: The launch-film scorecard reflects a seven-film reference corpus, which limits the range of styles it can represent.
Metric gaming creates an additional risk during synthesis. An evolutionary search can raise the critic’s score while producing a sound that fares poorly in listening. The project recommends combining learned scores with one-third-octave tonal measurements, side-by-side spectrograms, rerenders using fresh random seeds, and human blind tests.
Keep the models warm
Earshot requires Python 3.10 or newer, ffmpeg on the system path, and a CPU-compatible PyTorch installation. A GPU is optional.
Install from source
git clone https://github.com/Leonxlnx/earshot.git
cd earshot
python3 -m venv .venv
source .venv/bin/activate
python -m pip install --upgrade pip
python -m pip install -e ".[mcp,llm,dev]"
earshot doctor --load
The initial doctor --load call downloads and initializes the models, verifies dependencies, and prepares the local environment. Windows installations use the virtual environment’s Scripts\python.exe path in place of .venv/bin/python.
Expose it through MCP
claude mcp add earshot --scope user \
-e EARSHOT_THREADS=3 \
-- /absolute/path/to/earshot/.venv/bin/python -m earshot mcp
The executable path must point to the Python binary inside Earshot’s virtual environment. EARSHOT_THREADS controls CPU concurrency, while the long-running MCP process keeps the models in memory between agent calls.
Call it from Python
from earshot import api
A persistent Python process also avoids repeated initialization. The project reports a 20-to-40-second startup cost when each operation launches through a separate one-shot CLI process.
Audio joins the agent loop
Agent pipelines can already inspect rendered frames, execute code, and respond to failing tests. Earshot adds machine-readable audio observations, uncertainty estimates, alternative interpretations, and timestamped corrections. Those outputs let an agent revise a synthesis recipe, move an effect, render again, and measure the result within the same workflow.
The author already uses Earshot inside a sibling motion-design skill called cinetic, where generated sounds are timed against rendered frames. Product demos, game prototypes, and interactive tutorials are similarly direct fits. Sound designers retain the aesthetic and narrative decisions, while Earshot handles repeatable checks such as detecting a whoosh that lands 80 milliseconds after a cut.