Sand AISand AI MAGI-2MAGI-2 est maintenant sur SandBase : vidéo 1080p avec audio natifEssayer maintenant

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.

Prix de base
$0.05USD / exécution
Exécution
async
Type de modèle
audio
Champs d'entrée
7
Route de production

Essayer le modèle

Bac à sable

Ouvrir le Playground
Entrée
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. Plage : de 1 à 7.
Output audio format.
SortiePrêt

Votre sortie apparaîtra ici

Complétez les entrées, puis cliquez sur Exécuter.

Fiche modèle

Spécifications

Tarification

Prix de base
$0.05 / exécution

Contexte et modalités

Entrée
Défini par le schéma
Sortie
audio

Fonctionnalités

Chat
Non pris en charge
Vision
Non pris en charge
Raisonnement
Non pris en charge
Sortie structurée
Non pris en charge
Appel de fonction
Non pris en charge
Entrée audio
Non pris en charge

Accès

Fournisseur
Meta
ID du modèle
meta/sam-audio/span-separate
Exécution
async
URL de base
https://api.sandbase.ai
API
Unified Run API
Point de terminaison
/v1/run

README de l'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.

Commencer à construire

Envoyez votre première requête

Point de terminaison compatible OpenAI avec authentification unifiée et suivi de l'utilisation.

API de production
point de terminaison Unified Run API
https://api.sandbase.ai/v1/run
ID du modèle
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

Schéma d'entrée

7 paramètres · 2 obligatoires · 5 facultatifs

ParamètreTypeObligatoireDescription
audiostringObligatoireAudio file or URL to process.
spansobject[]ObligatoireTime 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).
promptstringFacultatifOptional but recommended text describing the sound to isolate.
trim_to_spanbooleanFacultatifTrim the output to the span time range. If false, returns the full audio length with the target isolated throughout. · Par défaut : false
output_formatstringFacultatifOutput audio format. · Options : wav, mp3 · Par défaut : "wav"
wavmp3
reranking_candidatesintegerFacultatifNumber 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 · Par défaut : 1
use_sound_activity_rankingbooleanFacultatifRank reranking candidates by how well their non-silent regions match the spans. Works without a prompt; requires `reranking_candidates` > 1. · Par défaut : false
02

Schéma de sortie

ChampTypeDescription
idstringIdentifiant unique de la tâche de génération
statusstringStatut de la tâche : pending, running, completed, failed, timeout
modelstringModèle utilisé pour la génération
outputsarrayTableau des éléments de sortie
outputs[].urlstringURL de l'artefact généré
outputs[].content_typestringType MIME (par ex. image/png, video/mp4)
errorobject | nullDétails de l'erreur en cas d'échec, null en cas de succès
error.typestringCode de type d'erreur lisible par machine
error.messagestringDescription de l'erreur lisible par l'humain

Flux de travail asynchrone

Ce modèle s’exécute de manière asynchrone. Envoyez une requête, puis interrogez le résultat.

  1. Envoyer : faites un POST vers /v1/run et lisez le id renvoyé.
  2. Interroger : faites un GET sur /v1/run/{id} jusqu’à ce que le statut soit completed, failed ou timeout.
  3. Récupérer : lisez outputs dans la réponse terminée.

Choisissez votre modèle

Comparer les modèles

Tous les modèles d’image et de vidéo
ModèleTypePrix par défautLancement
MetaAudio$0.05 / exécution30 déc. 2025
MetaAudio$0.05 / exécution30 déc. 2025
MetaAudio$0.05 / exécution30 déc. 2025
MetaAudio$0.04 / exécution27 oct. 2025

Questions

FAQ

Comment appeler Meta SAM Audio Span Separate via SandBase ?

Créez une clé API SandBase, puis envoyez des requêtes avec l’identifiant de modèle "meta/sam-audio/span-separate" à Unified Run API (/v1/run) sur https://api.sandbase.ai. Les exemples de requêtes sur cette page montrent la charge utile exacte.

Ai-je besoin d’un compte Meta distinct ?

Non. Une seule clé API SandBase et un seul solde vous donnent accès à Meta SAM Audio Span Separate et aux autres modèles du catalogue ; vous n’avez pas besoin de créer un compte Meta séparément.