audiostringrequired
Audio file or URL to process (WAV, MP3, FLAC).
meta/sam-audio/separateSAM Audio by Meta isolates any sound in a recording from a text description, such as a voice, an instrument or a dog barking. It returns the isolated target and the residual audio as separate files.
Try the model
Select an example to load its inputs and result into the playground.
{
"audio": "https://static.sandbase.ai/examples/f8fec3d8-ddfe-43e2-98e6-d035d04578a2/input/3d1c2154-d87f-4d9f-b273-269231966b85.wav",
"prompt": "piano playing"
}{
"audio": "https://static.sandbase.ai/examples/a0306d69-3764-45b0-aab8-7328daa6c9db/input/ad8e7f33-b823-4f8f-912b-c8d75fdf9d4d.mp3",
"output_format": "wav",
"predict_spans": true,
"prompt": "toucan calls",
"reranking_candidates": 3
}{
"audio": "https://static.sandbase.ai/examples/fea0c27b-e894-4d26-85e7-bdda458a9a9a/input/650c3fdd-11c3-4882-a556-848766bfc6ea.m4a",
"predict_spans": true,
"prompt": "person talking"
}SAM Audio isolates any sound you describe in text and returns it with the residual track.
| Field | Type | Default | Notes |
|---|---|---|---|
audio | audio file or URL, required | — | Recording to separate (WAV, MP3, FLAC). |
prompt | string, required | — | Sound to isolate. |
predict_spans | boolean | false | Detect where the target sound occurs before separating. |
reranking_candidates | integer 1–7 | 1 | Extra candidates improve quality; each adds $0.025 per 30 s. |
output_format | wav / mp3 | wav | Output file format. |
| Field | Notes |
|---|---|
url | Isolated target sound. |
residual_url | Everything else (the input minus the target). |
duration | Output length in seconds. |
$0.05 per started 30 seconds of output audio, plus $0.025 per 30 seconds for each extra reranking candidate. The final charge uses the measured output length; the quote uses the input length (10 minutes if it cannot be read).
| Audio | Price |
|---|---|
| 30 s, 1 candidate | $0.05 |
| 2 min, 1 candidate | $0.20 |
| 2 min, 3 candidates | $0.40 |
Failed runs are not charged.
man singing or dog barking.Related: meta/, meta/.
Start building
Submit this model through the SandBase Unified Run API.
# The quoted heredoc keeps Unicode and shell metacharacters unchanged.
result=$(curl --fail-with-body --silent \
-X POST "https://api.sandbase.ai/v1/run" \
-H "Authorization: Bearer $SANDBASE_API_KEY" \
-H "Content-Type: application/json" \
--data-binary @- <<'SANDBASE_JSON'
{
"model": "meta/sam-audio/separate",
"audio": "https://v3b.fal.media/files/b/0a88511f/tUUCI9eDmeC2RqJEOXrZk_assets_avatar_multi_sing_woman.WAV",
"prompt": "piano playing",
"output_format": "wav",
"predict_spans": false,
"reranking_candidates": 1
}
SANDBASE_JSON
)
run_id=$(printf '%s' "$result" | jq -r .id)
for attempt in $(seq 1 120); do
status=$(printf '%s' "$result" | jq -r .status)
case "$status" in completed|failed|timeout) break ;; esac
sleep 2
result=$(curl --fail-with-body --silent \
-H "Authorization: Bearer $SANDBASE_API_KEY" \
"https://api.sandbase.ai/v1/run/$run_id")
done
status=$(printf '%s' "$result" | jq -r .status)
[ "$status" = completed ] || { echo "Generation ended: $status" >&2; exit 1; }
printf '%s\n' "$result"Create a SandBase API key and set it in your server environment. All requests use Bearer authentication.
export SANDBASE_API_KEY="YOUR_API_KEY"Keep the key on your server. Do not expose it in browser code or commit it to a repository.
POST to /v1/run with this model ID and its inputs. The request example above includes submission and polling.
Use the returned run ID to poll until the status is completed, failed or timeout. Read output only after completed.
curl "https://api.sandbase.ai/v1/run/$RUN_ID" \
-H "Authorization: Bearer $SANDBASE_API_KEY"Pass a publicly accessible file URL in the model’s image, video or audio field. Supported formats and limits are shown beside each Playground input.
Use the upload or replace control on supported image fields in the Playground. Video URL fields accept a hosted driving video; they do not imply video-upload support.
audiostringrequiredAudio file or URL to process (WAV, MP3, FLAC).
promptstringrequiredText describing the sound to isolate.
output_formatstringOutput audio format.
Default: "wav"
Possible values: "wav", "mp3"
predict_spansbooleanAutomatically predict the time spans where the target sound occurs.
Default: false
reranking_candidatesintegerNumber of candidates to generate and rank (1–7). Higher improves quality but adds $0.025 per 30 s per extra candidate.
Default: 1
Minimum: 1
Maximum: 7
{
"model": "meta/sam-audio/separate",
"audio": "https://v3b.fal.media/files/b/0a88511f/tUUCI9eDmeC2RqJEOXrZk_assets_avatar_multi_sing_woman.WAV",
"prompt": "piano playing",
"output_format": "wav",
"predict_spans": false,
"reranking_candidates": 1
}A completed run exposes its result in output. The following is the model’s saved example, not a new generation.
[
{
"duration": 26.6,
"residual_url": "https://static.sandbase.ai/examples/f8fec3d8-ddfe-43e2-98e6-d035d04578a2/output/e9790f5d-d910-4921-9a0c-dde0b86aa614.wav",
"url": "https://static.sandbase.ai/examples/f8fec3d8-ddfe-43e2-98e6-d035d04578a2/output/071d8150-da2e-4aea-9b6a-4b87c39e8247.wav"
}
]