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.
- Precio base
- $0.05USD / ejecución
- Ejecución
- async
- Tipo de modelo
- audio
- Campos de entrada
- 7
Probar el modelo
Entorno de pruebas
Su salida aparecerá aquí
Complete las entradas y luego haga clic en Ejecutar.
Ficha del modelo
Especificaciones
Precios
- Precio base
- $0.05 / ejecución
Contexto y modalidades
- Entrada
- Definido por esquema
- Salida
- audio
Capacidades
- Chat
- No compatible
- Visión
- No compatible
- Razonamiento
- No compatible
- Salida estructurada
- No compatible
- Llamadas a funciones
- No compatible
- Entrada de audio
- No compatible
Acceso
- Proveedor
- Meta
- ID del modelo
- meta/sam-audio/span-separate
- Ejecución
- async
- URL base
- https://api.sandbase.ai
- API
- Unified Run API
- Endpoint
- /v1/run
README de la 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.
Empiece a construir
Envíe su primera solicitud
Endpoint compatible con OpenAI con autenticación unificada y seguimiento 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 obligatorios · 5 opcionales
| Parámetro | Tipo | Obligatorio | Descripción |
|---|---|---|---|
audio | string | Obligatorio | Audio file or URL to process. |
spans | object[] | Obligatorio | 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. · Valor predeterminado: false |
output_format | string | Opcional | Output audio format. · Opciones: wav, mp3 · Valor predeterminado: "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 · Valor predeterminado: 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. · Valor predeterminado: false |
Esquema de salida
| Campo | Tipo | Descripción |
|---|---|---|
id | string | Identificador único de la tarea de generación |
status | string | Estado de la tarea: pending, running, completed, failed, timeout |
model | string | Modelo usado para la generación |
outputs | array | Matriz de elementos de salida |
outputs[].url | string | URL del artefacto generado |
outputs[].content_type | string | Tipo MIME (por ejemplo, image/png, video/mp4) |
error | object | null | Detalles del error si falla; null en caso de éxito |
error.type | string | Código de tipo de error legible por máquina |
error.message | string | Descripción del error legible por humanos |
Flujo asíncrono
Este modelo se ejecuta de forma asíncrona. Envía una solicitud y luego consulta el resultado.
- Enviar: haz POST a /v1/run y lee el
iddevuelto. - Consultar: haz GET a /v1/run/{id} hasta que el estado sea
completed,failedotimeout. - Recuperar: lee
outputsde la respuesta completada.
Elija su modelo
Comparar modelos
| Modelo | Tipo | Precio predeterminado | Lanzamiento |
|---|---|---|---|
SAM Audio Span SeparateEste modelo Meta | Audio | $0.05 / ejecución | 30 dic 2025 |
Meta | Audio | $0.05 / ejecución | 30 dic 2025 |
Meta | Audio | $0.05 / ejecución | 30 dic 2025 |
Meta | Audio | $0.04 / ejecución | 27 oct 2025 |
Preguntas
FAQ
¿Cómo llamo a Meta SAM Audio Span Separate a través de SandBase?
Crea una clave API de SandBase y luego envía solicitudes con el ID de modelo "meta/sam-audio/span-separate" a Unified Run API (/v1/run) en https://api.sandbase.ai. Los ejemplos de solicitud de esta página muestran el payload exacto.
¿Necesito una cuenta separada de Meta?
No. Una sola clave API y saldo de SandBase te dan acceso a Meta SAM Audio Span Separate y a los demás modelos del catálogo; no necesitas registrarte aparte en Meta.
