audiostring必須
Audio file or URL to process (WAV, MP3, FLAC).
meta/sam-audio/separateSAM Audio by Meta isolates any sound in a recording from a text description, such as a voice, an instrument or a dog barking. It returns the isolated target and the residual audio as separate files.
モデルを試す
例を選択すると、その入力と結果がプレイグラウンドに読み込まれます。
{
"audio": "https://static.sandbase.ai/examples/f8fec3d8-ddfe-43e2-98e6-d035d04578a2/input/3d1c2154-d87f-4d9f-b273-269231966b85.wav",
"prompt": "piano playing"
}{
"audio": "https://static.sandbase.ai/examples/a0306d69-3764-45b0-aab8-7328daa6c9db/input/ad8e7f33-b823-4f8f-912b-c8d75fdf9d4d.mp3",
"output_format": "wav",
"predict_spans": true,
"prompt": "toucan calls",
"reranking_candidates": 3
}{
"audio": "https://static.sandbase.ai/examples/fea0c27b-e894-4d26-85e7-bdda458a9a9a/input/650c3fdd-11c3-4882-a556-848766bfc6ea.m4a",
"predict_spans": true,
"prompt": "person talking"
}SAM Audio isolates any sound you describe in text and returns it with the residual track.
| Field | Type | Default | Notes |
|---|---|---|---|
audio | audio file or URL, required | — | Recording to separate (WAV, MP3, FLAC). |
prompt | string, required | — | Sound to isolate. |
predict_spans | boolean | false | Detect where the target sound occurs before separating. |
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. |
| Field | Notes |
|---|---|
url | Isolated target sound. |
residual_url | Everything else (the input minus the target). |
duration | Output length in seconds. |
$0.05 per started 30 seconds of output audio, 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.
man singing or dog barking.Related: meta/, meta/.
開発を始める
このモデルをSandBase Unified Run API経由で送信します。
# 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/separate",
"audio": "https://v3b.fal.media/files/b/0a88511f/tUUCI9eDmeC2RqJEOXrZk_assets_avatar_multi_sing_woman.WAV",
"prompt": "piano playing",
"output_format": "wav",
"predict_spans": false,
"reranking_candidates": 1
}
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"SandBaseのAPIキーを作成し、サーバー環境に設定してください。すべてのリクエストはBearer認証を使用します。
export SANDBASE_API_KEY="YOUR_API_KEY"キーはサーバー側で管理してください。ブラウザコードに公開したり、リポジトリにコミットしたりしないでください。
このモデルIDと入力を使って /v1/run にPOSTしてください。上のリクエスト例には送信とポーリングが含まれています。
返されたrun IDを使って、ステータスがcompleted、failed、timeoutになるまでポーリングしてください。出力はcompleted後にのみ読み取ってください。
curl "https://api.sandbase.ai/v1/run/$RUN_ID" \
-H "Authorization: Bearer $SANDBASE_API_KEY"モデルのimage、video、またはaudioフィールドに、公開アクセス可能なファイルURLを指定してください。対応形式と制限は各Playground入力の横に表示されます。
Playgroundの対応する画像フィールドでアップロードまたは置換を使用してください。video URLフィールドはホストされたドライビング動画を受け付けますが、動画アップロード対応を意味するものではありません。
audiostring必須Audio file or URL to process (WAV, MP3, FLAC).
promptstring必須Text describing the sound to isolate.
output_formatstringOutput audio format.
デフォルト: "wav"
指定可能な値: "wav", "mp3"
predict_spansbooleanAutomatically predict the time spans where the target sound occurs.
デフォルト: false
reranking_candidatesintegerNumber of candidates to generate and rank (1–7). Higher improves quality but adds $0.025 per 30 s per extra candidate.
デフォルト: 1
最小: 1
最大: 7
{
"model": "meta/sam-audio/separate",
"audio": "https://v3b.fal.media/files/b/0a88511f/tUUCI9eDmeC2RqJEOXrZk_assets_avatar_multi_sing_woman.WAV",
"prompt": "piano playing",
"output_format": "wav",
"predict_spans": false,
"reranking_candidates": 1
}完了したrunの結果は出力に表示されます。以下はモデルに保存されたサンプルであり、新規生成ではありません。
[
{
"duration": 26.6,
"residual_url": "https://static.sandbase.ai/examples/f8fec3d8-ddfe-43e2-98e6-d035d04578a2/output/e9790f5d-d910-4921-9a0c-dde0b86aa614.wav",
"url": "https://static.sandbase.ai/examples/f8fec3d8-ddfe-43e2-98e6-d035d04578a2/output/071d8150-da2e-4aea-9b6a-4b87c39e8247.wav"
}
]