Audio Isolation removes background noise from audio files, producing clean speech output. This is perfect for cleaning up recordings before voice cloning, dubbing, or general audio processing.
from elevenlabs.client import ElevenLabsclient = ElevenLabs(api_key="YOUR_API_KEY")audio = client.audio_isolation.convert( audio=open("noisy_audio.mp3", "rb"))# Save the cleaned audiowith open("clean_audio.mp3", "wb") as f: for chunk in audio: f.write(chunk)
from elevenlabs.client import ElevenLabsclient = ElevenLabs(api_key="YOUR_API_KEY")audio_stream = client.audio_isolation.stream( audio=open("noisy_recording.mp3", "rb"))# Process the cleaned audio streamwith open("cleaned_output.mp3", "wb") as f: for chunk in audio_stream: f.write(chunk)
# Input must be 16-bit PCM at 16kHz, single channel (mono), little-endianaudio = client.audio_isolation.convert( audio=open("input.pcm", "rb"), file_format="pcm_s16le_16")with open("output.pcm", "wb") as f: for chunk in audio: f.write(chunk)
Audio isolation works best on recordings with clear speech
For voice cloning, always clean samples first for better results
Use PCM input format for real-time or low-latency applications
Process files in parallel for large batches
Keep original files as backups
Audio isolation is designed for speech. It may not work well for music or non-speech audio where background elements are important.
If the input audio does not contain background noise, using audio isolation may actually reduce quality. Only use this feature when background noise is present.
from elevenlabs.client import ElevenLabsclient = ElevenLabs(api_key="YOUR_API_KEY")try: audio = client.audio_isolation.convert( audio=open("noisy.mp3", "rb") ) with open("clean.mp3", "wb") as f: for chunk in audio: f.write(chunk) print("Audio cleaned successfully")except FileNotFoundError: print("Input file not found")except Exception as e: print(f"Error during audio isolation: {e}")