> ## Documentation Index
> Fetch the complete documentation index at: https://developers.mihu.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Audio isolation

> Get a recording back without background voices and noise

Send a recording, get it back with **background voices and noise removed** — for archives, call
recordings before listening or sharing, or as a cleaner input for your own processing. Files only (not live audio);
runs on CPU on the server.

What happens to a file:

1. The voices are analysed exactly as `voice_isolation=true` does for a transcription: the person who speaks first is
   kept (or, with `reference_voiceprint`, the [stored person](https://developers.mihu.ai/stt/voiceprints.md), even if someone else speaks first).
2. **A second voice is confirmed** → the voice isolation model removes the other voices over the whole file
   (conditioned on the kept person's voiceprint), then a 48 kHz speech enhancement model removes the noise.
   `isolation: "voice+noise"`.
3. **No second voice** (or `remove_voices=false`) → speech enhancement only. `isolation: "noise"`.

The answer always has exactly the duration of the input.

**One person is kept.** On a conversation recorded in one channel (agent and customer in the same mono file) the other
party counts as a second voice and is removed. To clean such a recording without losing anyone, send
`remove_voices=false` (noise removal only).

```bash theme={null}
curl https://stt.eu.mihu.ai/v1/audio/isolation -H "Authorization: Bearer $KEY" \
  -F file=@call.wav -o clean.wav -D -
# HTTP/1.1 200 OK · content-type: audio/wav · x-isolation: voice+noise · x-audio-seconds: 63.200
```

| Field | Default | Meaning |
| - | - | - |
| `file` / `file_url` | — | The recording (WAV, MP3, FLAC, OGG; any sample rate, mono or stereo — stereo is mixed down). `file_url` as for [transcriptions](https://developers.mihu.ai/stt/async.md#downloading-from-a-url-file_url) |
| `language` | `tr` (or the server's language) | Language of the speech; used to analyse the voices. Other voices are removed for `tr`, `de`, `fr`, `it`, `es`, `ru`; for other languages (e.g. `en`) only noise is removed |
| `reference_voiceprint` | — | Id or `vpt1.` token of a [voiceprint](https://developers.mihu.ai/stt/voiceprints.md): keep this person, remove everyone else |
| `remove_voices` | `true` | `false`: never remove voices, only noise (conversations; not combinable with `reference_voiceprint`) |
| `response_format` | `wav` | `wav` (16-bit PCM), `flac` (16-bit, lossless, \~half the size) or `mp3` |
| `sample_rate` | `48000` | `48000` or `16000` (Hz) of the answer |
| `webhook_url`, `webhook_secret`, `webhook_metadata` | — | Asynchronous job (below); **required for audio longer than 2 minutes** |

Synchronous answer (no `webhook_url`, audio up to 120 s): the audio itself, with headers `X-Isolation`
(`voice+noise` | `noise`), `X-Audio-Seconds`, `X-Processing-Time`, `X-Sample-Rate`. A file longer than 120 s without
`webhook_url` → `400` (`"audio longer than 120 s: send webhook_url for an asynchronous job"`). When the server is
already cleaning other files, a synchronous request waits up to 30 s for its turn, then `503` (retry, or use a job).

Processing time: about **13–16 seconds per minute of audio** on our servers (voice analysis included; one cleanup at a
time per server so transcriptions are not slowed down). A 2-minute file answers in \~30 s; a 60-minute file takes
\~13–16 minutes as a job (jobs wait in line behind each other).

### Asynchronous: `webhook_url`

Exactly like [asynchronous transcription](https://developers.mihu.ai/stt/async.md) — same limits (20 jobs per key, 4
hours of audio, 1 GB upload), signatures, retries and `webhook_metadata`:

```bash theme={null}
curl https://stt.eu.mihu.ai/v1/audio/isolation -H "Authorization: Bearer $KEY" \
  -F file=@call-60min.mp3 -F response_format=flac \
  -F webhook_url=https://example.com/hooks/clean -F webhook_secret=$WEBHOOK_SECRET -F 'webhook_metadata={"call_id": "C-1042"}'
```

`202`:

```json theme={null}
{"id": "0b6f2a9e-5c1d-4e8b-9f3a-7d2c1e0a4b58", "object": "audio.isolation.job", "status": "queued", "duration": 3600.0,
 "created_at": 1793145600, "source": {"type": "upload", "filename": "call-60min.mp3", "size_bytes": 57600417},
 "request": {"language": "tr", "response_format": "flac", "sample_rate": 48000, "remove_voices": true}}
```

Webhook (`event` `isolation.completed` / `isolation.failed`, header `X-Mihu-Event`):

```json theme={null}
{"event": "isolation.completed", "id": "0b6f2a9e-5c1d-4e8b-9f3a-7d2c1e0a4b58", "object": "audio.isolation.job",
 "status": "completed", "message": "Audio isolation of call-60min.mp3 (3600 s, tr) completed in 655.2 s.",
 "language": "tr", "duration": 3600.0, "processing_time": 655.2, "created_at": 1793145600, "started_at": 1793145601,
 "completed_at": 1793146256, "expires_at": 1793149856, "source": {…}, "request": {…},
 "result": {"isolation": "voice+noise", "duration": 3600.0, "format": "flac", "sample_rate": 48000,
            "size_bytes": 201437662, "audio_url": "/v1/audio/isolation/0b6f2a9e-5c1d-4e8b-9f3a-7d2c1e0a4b58/audio",
            "expires_at": 1793149856},
 "metadata": {"call_id": "C-1042"}}
```

The webhook does not carry the audio: download it from `audio_url` (relative to the API base URL, e.g.
`https://stt.eu.mihu.ai`) with the same API key before `expires_at`.

| Method | Path | |
| - | - | - |
| `GET` | `/v1/audio/isolation/{id}` | Status (`queued` → `processing` → `completed` / `failed`, `progress` 0–1) and, when completed, `result` |
| `GET` | `/v1/audio/isolation/{id}/audio` | The isolated audio (`409` while not completed, `404` after `expires_at`) |
| `DELETE` | `/v1/audio/isolation/{id}` | Deletes the job and its audio at once (finished jobs) |

Only the API key (tenant) that created the job sees it; any other key gets `404`.

### Billing and data retention

* Billed like a file transcription: the audio duration, once — on the synchronous answer or on the `202`
  (`X-Audio-Seconds`). Status reads, downloads and deletes are not billed.
* The uploaded recording is deleted as soon as it has been processed. The isolated audio is kept for **1 hour after
  completion** (`expires_at`) only so you can download it, then deleted automatically; `DELETE` removes it earlier.
  Synchronous requests keep nothing. Everything stays on the server of the region you call.

### Quality — what to expect

Measured on 92 synthetic Turkish mixtures (FLEURS speech, DEMAND / MUSAN noise; leak = level of what is left of the
unwanted sound, relative to the kept voice; lower is better):

| Situation | Wideband (16–48 kHz) | Telephone (8 kHz) |
| - | - | - |
| Other voice speaking **alone** (pauses of the kept person) | **≈ −53 dB**: practically gone | ≈ −13 dB: **still audible** |
| Other voice **talking over** the kept person | ≈ −18 dB: quieter but **still audible** | ≈ −8 dB: hardly reduced |
| Noise, with a second voice (`voice+noise`) | ≈ −34 dB | ≈ −31 dB |
| Noise, no second voice (`noise`) | ≈ −44 dB | ≈ −46 dB |

* On telephone (8 kHz) recordings a quieter background voice is often not confirmed as a second voice; the file then
  gets noise removal only (`X-Isolation: noise`).
* Works best on wideband recordings where the voices take turns. Simultaneous speech and telephone audio are the hard
  cases: the other voice gets quieter but is not fully removed. Equal-level voices of the same gender are the hardest.
* `voice+noise` costs some quality of the kept voice (artefacts in words that overlap the other voice); clean speech
  passes almost unchanged on the `noise` path.
* Without `reference_voiceprint` the first speaker is kept. If someone else speaks first (e.g. an agent greeting
  before the customer), send the voiceprint of the person you want.
* The `voice+noise` output is band-limited to 8 kHz (the voice isolation model works at 16 kHz); the `noise` path keeps
  the full band of a 48 kHz recording.
* Music: vocals may be kept as speech.
* Safety net: where recognised words of the kept person would come out silenced (the model can mistake speech for
  noise when a recording changes character, e.g. wideband audio followed by a telephone line), that stretch is redone
  in short pieces or, failing that, left without noise removal rather than losing the speech.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.