Podcast clean-up
Remove a barking dog, a siren or keyboard clicks; keep the residual.
“dog barking”Model · Meta SAM Audio · sound separation
Overview
Meta’s Segment Anything model for audio, released in December 2025, that isolates the sound you ask for from a mixed recording.
Prompting
Describe it, point at it, or say when it happens. Combine them for the most control.
Models
Three sizes, a “-tv” variant of each, plus two helper models.
| Checkpoint | Use it for |
|---|---|
sam-audio-small | Lightest; quick tests and smaller GPUs |
sam-audio-base | Balance of speed and quality |
sam-audio-large | Best overall separation quality |
sam-audio-{small,base,large}-tv | Better at picking the correct target sound and at visual prompting |
sam-audio-judge | Scores candidate separations for reranking |
pe-av-large | Perception Encoder Audio-Visual, used by SAM Audio and the Judge |
All are under facebook/ on Hugging Face and gated: request access, then hf auth login. Same steps as for SAM 3: Hugging Face access guide.
Under the hood
An audio-visual encoder understands the mix and the prompt; the model generates separations, and a scorer can pick the best one.
No code
Menu names may change as Meta updates the site.
sam_audio package; others reimplement it with converted weights. Check each pack’s licence and model source.Python
Install Meta’s package, then separate with text, span or visual prompts.
terminal
git clone https://github.com/facebookresearch/sam-audio.git
cd sam-audio && pip install . # Python 3.11+, CUDA GPU recommended
# request access to the facebook/sam-audio-* repos on Hugging Face first
hf auth logintext prompt
import torch
import torchaudio
from sam_audio import SAMAudio, SAMAudioProcessor
model = SAMAudio.from_pretrained("facebook/sam-audio-large").eval().cuda()
processor = SAMAudioProcessor.from_pretrained("facebook/sam-audio-large")
batch = processor(audios=["podcast.wav"], descriptions=["dog barking"]).to("cuda")
with torch.inference_mode():
result = model.separate(batch, predict_spans=False, reranking_candidates=1) # fast settings
sr = processor.audio_sampling_rate
torchaudio.save("dog_barking.wav", result.target.cpu(), sr) # the isolated sound
torchaudio.save("podcast_clean.wav", result.residual.cpu(), sr) # everything elsespan prompt + quality settings
# span prompt: the horn is audible from 6.3 s to 7.0 s ("+" = present, "-" = absent)
batch = processor(audios=["street.wav"], descriptions=["car honking"],
anchors=[[["+", 6.3, 7.0]]]).to("cuda")
# better quality: predict spans for intermittent sounds and rerank 8 candidates
with torch.inference_mode():
result = model.separate(batch, predict_spans=True, reranking_candidates=8) # slower, more memoryvisual prompt
# visual prompt: isolate the person SAM 3 tracked in the video
# frames: the video frames; mask: that person's masks, e.g. collected from a SAM 3 video session
# (match the frame/mask format used in the sam-audio visual-prompting example notebook)
model = SAMAudio.from_pretrained("facebook/sam-audio-large-tv").eval().cuda() # -tv: better for visual prompts
processor = SAMAudioProcessor.from_pretrained("facebook/sam-audio-large-tv")
batch = processor(audios=["interview.mp4"], descriptions=[""],
masked_videos=processor.mask_videos([frames], [mask])).to("cuda")
with torch.inference_mode():
result = model.separate(batch, reranking_candidates=1)
torchaudio.save("speaker_1.wav", result.target.cpu(), processor.audio_sampling_rate)Calls follow Meta’s sam-audio README; the examples folder has full notebooks for each prompt type. Start with reranking_candidates=1 and raise it once everything runs.
Better together
SAM 3 finds and tracks the speaker or instrument; SAM Audio uses those masks to extract its sound.
Getting per-frame masks: video segmentation with Python · select one object in video
Use cases
Remove a barking dog, a siren or keyboard clicks; keep the residual.
“dog barking”Pull out vocals or one instrument from a band recording.
“singing voice”Filter traffic or wind out of a vlog or interview.
“traffic noise”Click the person to isolate their voice from the room.
visual promptExtract clean effects (doors, birds, applause) from field recordings.
text + spanIsolate speech for transcription or focus on one sound source for analysis.
“man speaking”More ideas across the SAM family: use cases
Tips
| Do | Avoid |
|---|---|
Short lowercase phrases: thunder, man speaking | Sentences like “Thunder can be heard in the background” |
| Add a span when the sound comes and goes | Relying on text alone for a sound that appears once |
| Use a visual prompt when two similar sources are on screen | “woman speaking” when two women are talking |
| Turn on span prediction and reranking for final exports | Max settings while you’re still testing prompts |
| Listen to the residual too | Checking only the target track |
Limitations
Meta lists these limits; plan around them.
Questions
SAM Audio is Meta’s Segment Anything model for sound. You describe, click or mark the sound you want, and it returns that sound on its own plus everything else as a separate track.
Text (“dog barking”), visual (click or mask a person or object in a video) and time spans (mark when the sound happens). They can be combined.
The code and weights are published under the SAM License; the checkpoints on Hugging Face are gated and need an access request. You can also try it free in the Segment Anything Playground.
No. It isolates the sound you prompt for. It doesn’t split a mix into all its sources without a prompt.
Not currently. Meta lists audio-example prompts as a limitation.
They’re separate models in the same Segment Anything family. SAM 3 can create the video masks that SAM Audio uses as visual prompts.
Large gives the best quality; small and base are lighter. The “-tv” variants are better at picking the right target sound and at visual prompting.