Sand AISand AI MAGI-2MAGI-2 è ora su SandBase: video in 1080p con audio nativoProvalo ora

SAM Audio Span Separate

meta/sam-audio/span-separate

SAM 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
Route di produzione

Prova il modello

Playground

Apri playground
Input
Audio file or URL to process.
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).
Optional but recommended text describing the sound to isolate.
Trim the output to the span time range. If false, returns the full audio length with the target isolated throughout.
Rank reranking candidates by how well their non-silent regions match the spans. Works without a prompt; requires `reranking_candidates` > 1.
17
Number of candidates to generate and rank (1–7). Higher improves quality but adds $0.025 per 30 s per extra candidate. Intervallo: da 1 a 7.
Output audio format.
OutputPronto

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

FieldTypeDefaultNotes
audioaudio file or URL, required—Recording to separate.
spansarray of {start, end, include}, required—Time ranges in seconds; include: false marks ranges to exclude.
promptstring—Optional hint about the sound.
trim_to_spanbooleanfalseReturn only the span range instead of the full length.
use_sound_activity_rankingbooleanfalseRank candidates by match to the spans; needs more than one candidate.
reranking_candidatesinteger 1–71Extra candidates improve quality; each adds $0.025 per 30 s.
output_formatwav / mp3wavOutput file format.

Output

FieldNotes
urlIsolated target sound.
residual_urlEverything else (the input minus the target).
durationOutput 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).

AudioPrice
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 barking for 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.

API di produzione
Endpoint Unified Run API
https://api.sandbase.ai/v1/run
ID del modello
meta/sam-audio/span-separate
# 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"
01

Schema di input

7 parametri · 2 obbligatori · 5 facoltativi

ParametroTipoObbligatorioDescrizione
audiostringObbligatorioAudio file or URL to process.
spansobject[]ObbligatorioTime 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).
promptstringFacoltativoOptional but recommended text describing the sound to isolate.
trim_to_spanbooleanFacoltativoTrim the output to the span time range. If false, returns the full audio length with the target isolated throughout. · Predefinito: false
output_formatstringFacoltativoOutput audio format. · Opzioni: wav, mp3 · Predefinito: "wav"
wavmp3
reranking_candidatesintegerFacoltativoNumber 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_rankingbooleanFacoltativoRank reranking candidates by how well their non-silent regions match the spans. Works without a prompt; requires `reranking_candidates` > 1. · Predefinito: false
02

Schema di output

CampoTipoDescrizione
idstringIdentificatore univoco dell'attività di generazione
statusstringStato dell'attività: pending, running, completed, failed, timeout
modelstringModello usato per la generazione
outputsarrayArray di elementi di output
outputs[].urlstringURL dell'artefatto generato
outputs[].content_typestringTipo MIME (ad esempio image/png, video/mp4)
errorobject | nullDettagli dell'errore in caso di fallimento, null in caso di successo
error.typestringCodice del tipo di errore leggibile dalla macchina
error.messagestringDescrizione dell'errore leggibile dall'utente

Workflow asincrono

Questo modello funziona in modo asincrono. Invia una richiesta, quindi esegui il polling per ottenere il risultato.

  1. Invio: esegui POST su /v1/run e leggi il id restituito.
  2. Polling: esegui GET /v1/run/{id} finché lo stato non è completed, failed o timeout.
  3. Recupero: leggi outputs dalla risposta completata.

Scegli il tuo modello

Confronta i modelli

Tutti i modelli di immagini e video
ModelloTipoPrezzo predefinitoRilasciato
MetaAudio$0.05 / esecuzione30 dic 2025
MetaAudio$0.05 / esecuzione30 dic 2025
MetaAudio$0.05 / esecuzione30 dic 2025
MetaAudio$0.04 / esecuzione27 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.