Sand AISand AI MAGI-2MAGI-2 jest teraz na SandBase: wideo 1080p z natywnym dźwiękiemWypróbuj teraz

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.

Cena bazowa
$0.05USD / uruchomienie
Wykonanie
async
Typ modelu
audio
Pola wejściowe
7
Trasa produkcyjna

Wypróbuj model

Playground

Otwórz Playground
Wejście
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. Zakres: od 1 do 7.
Output audio format.
WyjścieGotowe

Twój wynik pojawi się tutaj

Uzupełnij dane wejściowe, a następnie kliknij Uruchom.

Karta modelu

Specyfikacja

Cennik

Cena bazowa
$0.05 / uruchomienie

Kontekst i modalności

Wejście
Zdefiniowane przez schemat
Wyjście
audio

Możliwości

Czat
Nieobsługiwane
Wizja
Nieobsługiwane
Rozumowanie
Nieobsługiwane
Ustrukturyzowany wynik
Nieobsługiwane
Wywoływanie funkcji
Nieobsługiwane
Wejście audio
Nieobsługiwane

Dostęp

Dostawca
Meta
ID modelu
meta/sam-audio/span-separate
Wykonanie
async
Bazowy URL
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.

Zacznij tworzyć

Wyślij pierwsze żądanie

Kompatybilny z OpenAI endpoint z jednolitym uwierzytelnianiem i śledzeniem użycia.

API produkcyjne
endpoint Unified Run API
https://api.sandbase.ai/v1/run
ID modelu
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

Schemat wejścia

7 parametrów · 2 wymaganych · 5 opcjonalnych

ParametrTypWymaganeOpis
audiostringWymaganeAudio file or URL to process.
spansobject[]WymaganeTime 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).
promptstringOpcjonalneOptional but recommended text describing the sound to isolate.
trim_to_spanbooleanOpcjonalneTrim the output to the span time range. If false, returns the full audio length with the target isolated throughout. · Domyślnie: false
output_formatstringOpcjonalneOutput audio format. · Opcje: wav, mp3 · Domyślnie: "wav"
wavmp3
reranking_candidatesintegerOpcjonalneNumber of candidates to generate and rank (1–7). Higher improves quality but adds $0.025 per 30 s per extra candidate. · Min.: 1 · Maks.: 7 · Domyślnie: 1
use_sound_activity_rankingbooleanOpcjonalneRank reranking candidates by how well their non-silent regions match the spans. Works without a prompt; requires `reranking_candidates` > 1. · Domyślnie: false
02

Schemat wyjścia

PoleTypOpis
idstringUnikalny identyfikator zadania generowania
statusstringStatus zadania: pending, running, completed, failed, timeout
modelstringModel użyty do generowania
outputsarrayTablica elementów wyjściowych
outputs[].urlstringURL wygenerowanego artefaktu
outputs[].content_typestringTyp MIME (np. image/png, video/mp4)
errorobject | nullSzczegóły błędu, jeśli wystąpił; null w przypadku powodzenia
error.typestringMaszynowo czytelny kod typu błędu
error.messagestringOpis błędu czytelny dla człowieka

Asynchroniczny przepływ pracy

Ten model działa asynchronicznie. Wyślij żądanie, a następnie odpytyuj o wynik.

  1. Wyślij: wykonaj POST do /v1/run i odczytaj zwrócone id.
  2. Odpytywanie: wykonuj GET /v1/run/{id}, aż status będzie równy completed, failed lub timeout.
  3. Pobierz: odczytaj outputs z ukończonej odpowiedzi.

Wybierz swój model

Porównaj modele

Wszystkie modele obrazu i wideo
ModelTypCena domyślnaWydano
MetaAudio$0.05 / uruchomienie30 gru 2025
MetaAudio$0.05 / uruchomienie30 gru 2025
MetaAudio$0.05 / uruchomienie30 gru 2025
MetaAudio$0.04 / uruchomienie27 paź 2025

Pytania

FAQ

Jak wywołać Meta SAM Audio Span Separate przez SandBase?

Utwórz klucz API SandBase, a następnie wysyłaj żądania z identyfikatorem modelu "meta/sam-audio/span-separate" do Unified Run API (/v1/run) na https://api.sandbase.ai. Przykłady żądań na tej stronie pokazują dokładny payload.

Czy potrzebuję osobnego konta Meta?

Nie. Jeden klucz API SandBase i saldo daje Ci dostęp do Meta SAM Audio Span Separate oraz innych modeli w katalogu; nie musisz osobno zakładać konta u Meta.