Sand AISand AI MAGI-2MAGI-2 kini tersedia di SandBase: video 1080p dengan audio nativeCoba sekarang

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.

Harga dasar
$0.05USD / run
Eksekusi
async
Jenis model
audio
Field input
7
Rute produksi

Coba model ini

Playground

Buka 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. Rentang: 1 hingga 7.
Output audio format.
OutputSiap

Output Anda akan muncul di sini

Lengkapi input, lalu klik Run.

Kartu model

Spesifikasi

Harga

Harga dasar
$0.05 / run

Konteks & modalitas

Input
Didefinisikan oleh skema
Output
audio

Kemampuan

Chat
Tidak didukung
Vision
Tidak didukung
Penalaran
Tidak didukung
Output terstruktur
Tidak didukung
Pemanggilan fungsi
Tidak didukung
Input audio
Tidak didukung

Akses

Penyedia
Meta
Model ID
meta/sam-audio/span-separate
Eksekusi
async
Base 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.

Mulai membangun

Kirim permintaan pertama Anda

Endpoint yang kompatibel dengan OpenAI dengan autentikasi dan pelacakan penggunaan terpadu.

Production API
Endpoint Unified Run API
https://api.sandbase.ai/v1/run
Model ID
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

Skema Input

7 parameter · 2 wajib · 5 opsional

ParameterTipeWajibDeskripsi
audiostringWajibAudio file or URL to process.
spansobject[]WajibTime 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).
promptstringOpsionalOptional but recommended text describing the sound to isolate.
trim_to_spanbooleanOpsionalTrim the output to the span time range. If false, returns the full audio length with the target isolated throughout. · Bawaan: false
output_formatstringOpsionalOutput audio format. · Opsi: wav, mp3 · Bawaan: "wav"
wavmp3
reranking_candidatesintegerOpsionalNumber 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 · Bawaan: 1
use_sound_activity_rankingbooleanOpsionalRank reranking candidates by how well their non-silent regions match the spans. Works without a prompt; requires `reranking_candidates` > 1. · Bawaan: false
02

Skema Output

FieldTipeDeskripsi
idstringPengidentifikasi unik untuk tugas generasi
statusstringStatus tugas: pending, running, completed, failed, timeout
modelstringModel yang digunakan untuk generasi
outputsarrayArray item output
outputs[].urlstringURL artefak yang dihasilkan
outputs[].content_typestringTipe MIME (mis. image/png, video/mp4)
errorobject | nullDetail error jika gagal, null jika berhasil
error.typestringKode jenis error yang dapat dibaca mesin
error.messagestringDeskripsi error yang dapat dibaca manusia

Alur Kerja Asinkron

Model ini berjalan secara asinkron. Kirim permintaan, lalu polling untuk hasilnya.

  1. Kirim: POST ke /v1/run dan baca id yang dikembalikan.
  2. Polling: GET /v1/run/{id} sampai status menjadi completed, failed, atau timeout.
  3. Ambil: baca outputs dari response yang selesai.

Pilih model Anda

Bandingkan model

Semua model gambar & video
ModelTipeHarga defaultRilis
MetaAudio$0.05 / run30 Des 2025
MetaAudio$0.05 / run30 Des 2025
MetaAudio$0.05 / run30 Des 2025
MetaAudio$0.04 / run27 Okt 2025

Pertanyaan

FAQ

Bagaimana cara memanggil Meta SAM Audio Span Separate melalui SandBase?

Buat kunci API SandBase, lalu kirim permintaan dengan model ID "meta/sam-audio/span-separate" ke Unified Run API (/v1/run) di https://api.sandbase.ai. Contoh permintaan di halaman ini menunjukkan payload yang tepat.

Apakah saya memerlukan akun Meta terpisah?

Tidak. Satu kunci API dan saldo SandBase memberi Anda akses ke Meta SAM Audio Span Separate dan model lain di katalog; Anda tidak perlu mendaftar ke Meta secara terpisah.