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.
- 基本料金
- $0.05USD / 実行
- 実行
- async
- モデルタイプ
- audio
- 入力フィールド
- 7
モデルを試す
プレイグラウンド
出力はここに表示されます
入力を完了してから[実行]をクリックしてください。
モデルカード
仕様
料金
- 基本価格
- $0.05 / 実行
コンテキストとモダリティ
- 入力
- スキーマ定義済み
- 出力
- audio
機能
- チャット
- 非対応
- ビジョン
- 非対応
- 推論
- 非対応
- 構造化出力
- 非対応
- 関数呼び出し
- 非対応
- 音声入力
- 非対応
アクセス
- 提供元
- Meta
- モデル ID
- meta/sam-audio/span-separate
- 実行
- async
- ベース URL
- https://api.sandbase.ai
- API
- Unified Run API
- エンドポイント
- /v1/run
API README
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.
開発を始める
最初のリクエストを送信
統一認証と使用状況の追跡を備えたOpenAI互換エンドポイントです。
# 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"入力スキーマ
7件のパラメータ · 必須 2件 · 任意 5件
| パラメータ | 型 | 必須 | 説明 |
|---|---|---|---|
audio | string | 必須 | Audio file or URL to process. |
spans | object[] | 必須 | 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 | 任意 | Optional but recommended text describing the sound to isolate. |
trim_to_span | boolean | 任意 | Trim the output to the span time range. If false, returns the full audio length with the target isolated throughout. · デフォルト: false |
output_format | string | 任意 | Output audio format. · オプション: wav, mp3 · デフォルト: "wav" wavmp3 |
reranking_candidates | integer | 任意 | Number of candidates to generate and rank (1–7). Higher improves quality but adds $0.025 per 30 s per extra candidate. · 最小: 1 · 最大: 7 · デフォルト: 1 |
use_sound_activity_ranking | boolean | 任意 | Rank reranking candidates by how well their non-silent regions match the spans. Works without a prompt; requires `reranking_candidates` > 1. · デフォルト: false |
出力スキーマ
| フィールド | 型 | 説明 |
|---|---|---|
id | string | 生成タスクの一意な識別子 |
status | string | タスクのステータス: pending, running, completed, failed, timeout |
model | string | 生成に使用されたモデル |
outputs | array | 出力項目の配列 |
outputs[].url | string | 生成された成果物のURL |
outputs[].content_type | string | MIMEタイプ(例: image/png, video/mp4) |
error | object | null | 失敗時のエラー詳細。成功時は null |
error.type | string | 機械可読なエラー種別コード |
error.message | string | 人間が読めるエラー説明 |
非同期ワークフロー
このモデルは非同期で実行されます。リクエストを送信し、その後結果をポーリングしてください。
- 送信:/v1/run に POST し、返された
idを読み取ります。 - ポーリング:ステータスが
completed、failed、またはtimeoutになるまで /v1/run/{id} に GET します。 - 取得:完了レスポンスから
outputsを読み取ります。
モデルを選ぶ
モデルを比較
| モデル | 種類 | 通常価格 | 公開日 |
|---|---|---|---|
Meta | 音声 | $0.05 / 回 | 2025年12月30日 |
Meta | 音声 | $0.05 / 回 | 2025年12月30日 |
Meta | 音声 | $0.05 / 回 | 2025年12月30日 |
Meta | 音声 | $0.04 / 回 | 2025年10月27日 |
質問
FAQ
SandBase 経由で Meta SAM Audio Span Separate を呼び出すにはどうすればよいですか?
SandBase API key を作成し、モデル ID「meta/sam-audio/span-separate」を使用して https://api.sandbase.ai の Unified Run API (/v1/run) にリクエストを送信してください。このページのリクエスト例に、正確なペイロードが示されています。
別途 Meta アカウントは必要ですか?
いいえ。SandBase の API key と残高が 1つあれば、Meta SAM Audio Span Separate とカタログ内の他のモデルを利用できます。Meta に別途登録する必要はありません。
