SAM Audio Span Separate
meta/sam-audio/span-separateSAM Audio by Meta isolates a sound using time spans that mark where it occurs, optionally guided by a text description. It returns the isolated target and the residual audio, either full length or trimmed to the spans.
- Prezzo base
- $0.05USD / esecuzione
- Esecuzione
- async
- Tipo di modello
- audio
- Campi di input
- 7
Prova il modello
Playground
Il tuo output apparirà qui
Completa gli input, poi fai clic su Esegui.
Scheda del modello
Specifiche
Prezzi
- Prezzo base
- $0.05 / esecuzione
Contesto e modalità
- Input
- Definito dallo schema
- Output
- audio
Funzionalità
- Chat
- Non supportato
- Vision
- Non supportato
- Ragionamento
- Non supportato
- Output strutturato
- Non supportato
- Chiamata di funzione
- Non supportato
- Input audio
- Non supportato
Accesso
- Provider
- Meta
- ID modello
- meta/sam-audio/span-separate
- Esecuzione
- async
- URL base
- https://api.sandbase.ai
- API
- Unified Run API
- Endpoint
- /v1/run
README API
SAM Audio Span Separate
SAM Audio isolates a sound from the time spans where it occurs, with an optional text hint, and returns it with the residual track.
Fields
| Field | Type | Default | Notes |
|---|---|---|---|
audio | audio file or URL, required | — | Recording to separate. |
spans | array of {start, end, include}, required | — | Time ranges in seconds; include: false marks ranges to exclude. |
prompt | string | — | Optional hint about the sound. |
trim_to_span | boolean | false | Return only the span range instead of the full length. |
use_sound_activity_ranking | boolean | false | Rank candidates by match to the spans; needs more than one candidate. |
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. |
Output
| Field | Notes |
|---|---|
url | Isolated target sound. |
residual_url | Everything else (the input minus the target). |
duration | Output length in seconds. |
Billing
$0.05 per started 30 seconds of output audio (shorter with trim_to_span), 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.
Prompting
- Mark a span where the target is clearly audible; add a short prompt such as
dog barkingfor better results.
Also on SandBase
Related: meta/sam-audio/separate, meta/sam-audio/visual-separate.
Inizia a costruire
Invia la tua prima richiesta
Endpoint compatibile con OpenAI con autenticazione unificata e tracciamento dell'utilizzo.
# 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/span-separate",
"audio": "https://v3b.fal.media/files/b/0a8853d1/T7zRmsiculA6u_V6RCF2c_man.mp3",
"spans": [
[
{
"end": 10,
"start": 6,
"include": true
}
]
],
"prompt": "man singing",
"trim_to_span": false,
"output_format": "wav",
"reranking_candidates": 1,
"use_sound_activity_ranking": false
}
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"Schema di input
7 parametri · 2 obbligatori · 5 facoltativi
| Parametro | Tipo | Obbligatorio | Descrizione |
|---|---|---|---|
audio | string | Obbligatorio | Audio file or URL to process. |
spans | object[] | Obbligatorio | Time spans where the target sound occurs. Each item has `start` and `end` in seconds and `include` (true to isolate sounds in this span, false to exclude them). |
prompt | string | Facoltativo | Optional but recommended text describing the sound to isolate. |
trim_to_span | boolean | Facoltativo | Trim the output to the span time range. If false, returns the full audio length with the target isolated throughout. · Predefinito: false |
output_format | string | Facoltativo | Output audio format. · Opzioni: wav, mp3 · Predefinito: "wav" wavmp3 |
reranking_candidates | integer | Facoltativo | Number of candidates to generate and rank (1–7). Higher improves quality but adds $0.025 per 30 s per extra candidate. · Min: 1 · Max: 7 · Predefinito: 1 |
use_sound_activity_ranking | boolean | Facoltativo | Rank reranking candidates by how well their non-silent regions match the spans. Works without a prompt; requires `reranking_candidates` > 1. · Predefinito: false |
Schema di output
| Campo | Tipo | Descrizione |
|---|---|---|
id | string | Identificatore univoco dell'attività di generazione |
status | string | Stato dell'attività: pending, running, completed, failed, timeout |
model | string | Modello usato per la generazione |
outputs | array | Array di elementi di output |
outputs[].url | string | URL dell'artefatto generato |
outputs[].content_type | string | Tipo MIME (ad esempio image/png, video/mp4) |
error | object | null | Dettagli dell'errore in caso di fallimento, null in caso di successo |
error.type | string | Codice del tipo di errore leggibile dalla macchina |
error.message | string | Descrizione dell'errore leggibile dall'utente |
Workflow asincrono
Questo modello funziona in modo asincrono. Invia una richiesta, quindi esegui il polling per ottenere il risultato.
- Invio: esegui POST su /v1/run e leggi il
idrestituito. - Polling: esegui GET /v1/run/{id} finché lo stato non è
completed,failedotimeout. - Recupero: leggi
outputsdalla risposta completata.
Scegli il tuo modello
Confronta i modelli
| Modello | Tipo | Prezzo predefinito | Rilasciato |
|---|---|---|---|
SAM Audio Span SeparateQuesto modello Meta | Audio | $0.05 / esecuzione | 30 dic 2025 |
Meta | Audio | $0.05 / esecuzione | 30 dic 2025 |
Meta | Audio | $0.05 / esecuzione | 30 dic 2025 |
Meta | Audio | $0.04 / esecuzione | 27 ott 2025 |
Domande
FAQ
Come chiamo Meta SAM Audio Span Separate tramite SandBase?
Crea una chiave API SandBase, poi invia richieste con l'ID modello "meta/sam-audio/span-separate" a Unified Run API (/v1/run) su https://api.sandbase.ai. Gli esempi di richiesta in questa pagina mostrano il payload esatto.
Mi serve un account Meta separato?
No. Una sola chiave API e un solo saldo SandBase ti danno accesso a Meta SAM Audio Span Separate e agli altri modelli del catalogo; non è necessario registrarsi separatamente su Meta.
