Skip to main content

Documentation Index

Fetch the complete documentation index at: https://mintlify.com/phpaisdk/elevenlabs/llms.txt

Use this file to discover all available pages before exploring further.

The Voice Isolator applies ElevenLabs audio isolation to a recording and returns a cleaned version that contains only the primary voice. Background music, crowd noise, room ambience, and other competing sounds are stripped out, leaving a clean vocal track. This is useful for preparing interview recordings, cleaning podcast content captured in imperfect conditions, or separating spoken audio from a mixed-down track before further processing.

Usage

Call ElevenLabs::voiceIsolator()->isolate() with the audio you want to clean wrapped in a Content::audio() value.
use AiSdk\Content;
use AiSdk\ElevenLabs;

$result = ElevenLabs::voiceIsolator()->isolate(
    Content::audio(__DIR__.'/noisy-interview.mp3'),
);

$result->output->save(__DIR__.'/clean.mp3');
The same method is available on a configured provider instance:
use AiSdk\Content;
use AiSdk\ElevenLabs;

$elevenLabs = ElevenLabs::create(['apiKey' => 'xi-...']);

$result = $elevenLabs->voiceIsolator()->isolate(
    Content::audio(__DIR__.'/noisy-interview.mp3'),
);

$result->output->save(__DIR__.'/clean.mp3');

Parameters

audio
Content
required
The audio to clean, wrapped in a Content::audio() value. Accepts a file path or inline bytes:
// From a file path
Content::audio(__DIR__.'/noisy-interview.mp3')

// From raw bytes with explicit MIME type and filename
Content::audio($rawBytes, 'audio/wav', 'noisy-interview.wav')
options
array
An optional associative array of additional fields to include in the multipart request body. Refer to the ElevenLabs audio isolation API documentation for supported fields such as file_format and preview_b64.
$result = ElevenLabs::voiceIsolator()->isolate(
    Content::audio(__DIR__.'/recording.wav'),
    ['file_format' => 'pcm_s16le_16'],
);

Return value

isolate() returns an AudioResult. Access the cleaned audio through its output property:
output
AudioData
The isolated vocal audio.
Save directly to a file path:
$result->output->save(__DIR__.'/clean.mp3');
Or access the raw bytes:
$bytes = $result->output->data;

Common use cases

Interview recordings

Clean up audio captured in cafes, offices, or conference rooms where background conversations and ambient noise bleed into the recording.

Podcast production

Strip room reverb or music bleed from guest tracks recorded on consumer microphones before mixing.

Vocal extraction

Separate a spoken vocal from a mixed-down audio file when you need a clean voice track for further processing.

Pre-processing pipeline

Use isolation as an upstream step before transcription or voice conversion to improve accuracy and output quality.
Voice isolation pairs naturally with the Voice Changer for a two-step transformation pipeline. First, remove background noise with voiceIsolator()->isolate(), then pass the cleaned output to voiceChanger()->convert() to apply a new target voice. This produces the cleanest speech-to-speech results when your source material was recorded in a noisy environment.
use AiSdk\Content;
use AiSdk\ElevenLabs;

// Step 1 — clean the source audio
$clean = ElevenLabs::voiceIsolator()->isolate(
    Content::audio(__DIR__.'/noisy-interview.mp3'),
);

// Step 2 — convert to target voice
$converted = ElevenLabs::voiceChanger()->convert(
    voiceId: 'JBFqnCBsd6RMkjVDRZzb',
    audio: Content::audio($clean->output->data, 'audio/mpeg', 'clean.mp3'),
    options: [
        'model_id'      => 'eleven_multilingual_sts_v2',
        'output_format' => 'mp3_44100_128',
    ],
);

$converted->output->save(__DIR__.'/final.mp3');

Full example

use AiSdk\Content;
use AiSdk\ElevenLabs;

ElevenLabs::create(['apiKey' => $_ENV['ELEVENLABS_API_KEY']]);

$result = ElevenLabs::voiceIsolator()->isolate(
    Content::audio(__DIR__.'/noisy-interview.mp3'),
);

$result->output->save(__DIR__.'/clean.mp3');

echo 'Saved isolated audio — ' . strlen($result->output->data) . ' bytes';

Build docs developers (and LLMs) love