Skip to navigation

Voice Isolator quickstart

Learn how to remove background noise from an audio file using the Voice Isolator API.

This guide will show you how to remove background noise from an audio file using the Voice Isolator API.

Use the ElevenLabs voice-isolator skill to remove background noise from audio files from your AI coding assistant:

npx skills add elevenlabs/skills --skill voice-isolator

Using the Voice Isolator API

1

Create an API key

Create an API key in the dashboard here, which you’ll use to securely access the API.

Store the key as a managed secret and pass it to the SDKs either as an environment variable via an .env file, or directly in your app’s configuration depending on your preference.

.env
ELEVENLABS_API_KEY=<your_api_key_here>
2

Install the SDK

Python and TypeScript also use dotenv to load your API key from a .env file. The other SDKs read ELEVENLABS_API_KEY from the environment.

pip install elevenlabs
pip install python-dotenv

To play the audio through your speakers, you may be prompted to install MPV and/or ffmpeg.

3

Make the API request

Create a new file named example.py or example.mts, depending on your language of choice and add the following code:

# example.py
import os
from dotenv import load_dotenv
from elevenlabs.client import ElevenLabs
from elevenlabs.play import play
import requests
from io import BytesIO
load_dotenv()
elevenlabs = ElevenLabs(
api_key=os.getenv("ELEVENLABS_API_KEY"),
)
audio_url = "https://storage.googleapis.com/eleven-public-cdn/documentation_assets/audio/voice_with_background.mp3"
response = requests.get(audio_url)
audio_data = BytesIO(response.content)
audio_stream = elevenlabs.audio_isolation.convert(audio=audio_data)
play(audio_stream)

Then run it:

python example.py

You should hear the isolated voice playing through your speakers.

Next steps