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.
- Preço base
- $0.05USD / execução
- Execução
- async
- Tipo de modelo
- audio
- Campos de entrada
- 7
Testar o modelo
Playground
Sua saída aparecerá aqui
Preencha as entradas e clique em Executar.
Cartão do modelo
Especificações
Preços
- Preço base
- $0.05 / execução
Contexto e modalidades
- Entrada
- Definido pelo schema
- Saída
- audio
Capacidades
- Chat
- Não suportado
- Visão
- Não suportado
- Raciocínio
- Não suportado
- Saída estruturada
- Não suportado
- Chamada de função
- Não suportado
- Entrada de áudio
- Não suportado
Acesso
- Provedor
- Meta
- ID do modelo
- meta/sam-audio/span-separate
- Execução
- async
- URL base
- https://api.sandbase.ai
- API
- Unified Run API
- Endpoint
- /v1/run
README da 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.
Comece a construir
Envie sua primeira solicitação
Endpoint compatível com OpenAI com autenticação unificada e rastreamento de uso.
# 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"Esquema de entrada
7 parâmetros · 2 obrigatórios · 5 opcionais
| Parâmetro | Tipo | Obrigatório | Descrição |
|---|---|---|---|
audio | string | Obrigatório | Audio file or URL to process. |
spans | object[] | Obrigatório | 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 | Opcional | Optional but recommended text describing the sound to isolate. |
trim_to_span | boolean | Opcional | Trim the output to the span time range. If false, returns the full audio length with the target isolated throughout. · Padrão: false |
output_format | string | Opcional | Output audio format. · Opções: wav, mp3 · Padrão: "wav" wavmp3 |
reranking_candidates | integer | Opcional | Number of candidates to generate and rank (1–7). Higher improves quality but adds $0.025 per 30 s per extra candidate. · Mín.: 1 · Máx.: 7 · Padrão: 1 |
use_sound_activity_ranking | boolean | Opcional | Rank reranking candidates by how well their non-silent regions match the spans. Works without a prompt; requires `reranking_candidates` > 1. · Padrão: false |
Esquema de saída
| Campo | Tipo | Descrição |
|---|---|---|
id | string | Identificador exclusivo da tarefa de geração |
status | string | Status da tarefa: pending, running, completed, failed, timeout |
model | string | Modelo usado para a geração |
outputs | array | Vetor de itens de saída |
outputs[].url | string | URL do artefato gerado |
outputs[].content_type | string | Tipo MIME (por exemplo, image/png, video/mp4) |
error | object | null | Detalhes do erro se houver falha, null em caso de sucesso |
error.type | string | Código do tipo de erro legível por máquina |
error.message | string | Descrição do erro legível por humanos |
Fluxo assíncrono
Este modelo é executado de forma assíncrona. Envie uma solicitação e depois faça polling pelo resultado.
- Enviar: faça POST para /v1/run e leia o
idretornado. - Fazer polling: faça GET em /v1/run/{id} até o status ser
completed,failedoutimeout. - Recuperar: leia
outputsda resposta concluída.
Escolha seu modelo
Comparar modelos
| Modelo | Tipo | Preço padrão | Lançado |
|---|---|---|---|
SAM Audio Span SeparateEste modelo Meta | Áudio | $0.05 / execução | 30 de dez. de 2025 |
Meta | Áudio | $0.05 / execução | 30 de dez. de 2025 |
Meta | Áudio | $0.05 / execução | 30 de dez. de 2025 |
Meta | Áudio | $0.04 / execução | 27 de out. de 2025 |
Perguntas
FAQ
Como faço chamadas ao Meta SAM Audio Span Separate pela SandBase?
Crie uma chave de API da SandBase e depois envie solicitações com o ID do modelo "meta/sam-audio/span-separate" para Unified Run API (/v1/run) em https://api.sandbase.ai. Os exemplos de requisição nesta página mostram a carga exata.
Preciso de uma conta Meta separada?
Não. Uma única chave de API e saldo da SandBase dão acesso a Meta SAM Audio Span Separate e aos outros modelos do catálogo; você não precisa se cadastrar separadamente no Meta.
