Local speech recognition & synthesis
Last updated
Separate voices and sounds in recordings with SAM Audio
Describe a sound, then separate the target from the remaining audio.
Meta's SAM Audio isolates a sound from a complex recording using a text description, visual cue, or time span. The official example runs on a CUDA1 GPU2 and requires requesting access to pretrained checkpoints3 and authenticating. It is a general audio source-separation tool for speech, music, and sound effects, not a dedicated vocal-removal model.
Separate a described sound from the rest
SAM Audio is a sound-separation model. In a meeting recording, specify a speaker, background music, or a horn with a natural-language description, time span, or visual cue. It returns the target signal and the remaining signal from the input mix. Meta's SAM Audio overview · Official repository

Prepare CUDA and checkpoint access
Prepare Python 3.11+ and a CUDA-compatible GPU, then install the official repository. First request and receive checkpoint access on the SAM Audio Hugging Face model card. Clone the repository, place meeting.wav in its root, and authenticate with the Hugging Face CLI4.
git clone https://github.com/facebookresearch/sam-audio.git
cd sam-audio
python -m pip install .python -m pip install "huggingface_hub[cli]"
hf auth login
# Enter the token in the interactive prompt
cp /path/to/meeting.wav ./meeting.wavDescribe the target sound precisely
Save the code below as separate.py and run it. The requested speech is saved to target.wav, and the remaining sound to residual.wav. Keep meeting.wav in the repository root; outputs use the processor’s sample rate5.
from sam_audio import SAMAudio, SAMAudioProcessor
import torchaudio
import torch
checkpoint = "facebook/sam-audio-large"
model = SAMAudio.from_pretrained(checkpoint).eval().cuda()
processor = SAMAudioProcessor.from_pretrained(checkpoint)
batch = processor(audios=["meeting.wav"], descriptions=["speech"]).to("cuda")
with torch.inference_mode():
result = model.separate(batch, predict_spans=False, reranking_candidates=1)
sample_rate = processor.audio_sampling_rate
torchaudio.save("target.wav", result.target[0].cpu().unsqueeze(0), sample_rate)
torchaudio.save("residual.wav", result.residual[0].cpu().unsqueeze(0), sample_rate)python separate.pyReview both target and residual signals
Check whether the target contains only the intended speaker or effect, and whether the residual still contains background speech you need. Results depend on the source recording and prompt6. If needed, narrow the description, such as one person's speech, or rerun with the official time-span prompting method.

Distinguish general separation from vocal removal
SAM Audio is a general audio-separation tool that targets speech, instruments, and sound effects using text, video, or time spans. For vocal removal, you can try a singing voice prompt on a music mix, but do not assume the quality or workflow matches a dedicated vocal/accompaniment model. Listen for distortion, reverb artifacts, and missing instruments in both outputs.
Check checkpoint terms and access conditions
Checkpoint approval grants access to the model files, but it does not grant rights to separate or share voices in a recording. Notify participants and follow your organization’s retention policy for meeting or counseling audio.

Terminology notes
CUDA — A software platform for general-purpose computing on NVIDIA GPUs.
Back to the textGPU — A processor designed to handle many calculations in parallel. It performs model computations during AI inference.
Back to the textCheckpoint — A file containing saved model weights and related state. Versions or tasks in one model family may use different checkpoints.
Back to the textCLI — Short for Command-Line Interface: operating a program by entering commands in a terminal.
Back to the textSampling rate — The number of times per second an audio signal is measured when digitized.
Back to the textPrompt — The input text sent to a model. For generative models it describes the desired result and strongly shapes the output.
Back to the text
Frequently asked questions
- What should you check first in this article?
- Meta's SAM Audio isolates a sound from a complex recording using a text description, visual cue, or time span. The official example runs on a CUDA GPU and requires requesting access to pretrained checkpoints and authenticating. It is a general audio source-separation tool for speech, music, and sound effects, not a dedicated vocal-removal model.
- When is it better not to choose this?
- SAM Audio is a general audio-separation tool that targets speech, instruments, and sound effects using text, video, or time spans. For vocal removal, you can try a `singing voice` prompt on a music mix, but do not assume the quality or workflow matches a dedicated vocal/accompaniment model. Listen for distortion, reverb artifacts, and missing instruments in both outputs.
Read next
Local speech recognition & synthesis
Local AI speech recognition: transcribe on your own PC
Local speech recognition & synthesis
Create local meeting notes with transcripts, timestamps, and speakers
Local music generation
Local AI music generation: make songs and background music on your computer
Local speech recognition & synthesis
Transcribe Korean speech live and save text with Nemotron 3.5 ASR
