sound-effects について
sound-effectsは、テキストの説明から効果音を生成するElevenLabsのスキルです。ループ、長さ、プロンプトへの追従度を設定でき、複数の音声形式に対応します。
主な機能
- 01説明文から効果音を生成
- 02ループ音の生成
- 03生成時間の指定
- 04プロンプト追従度の調整
- 05複数の音声形式を選択
活用シーン
- 01動画シーン用の環境音を作る
- 02ループ可能な背景音を生成する
- 03長さを指定したサウンドキューを作る
インストール
コマンドをコピーしてターミナルで実行します。
$
npx skills add https:/ / github.com/ calesthio/ openmontage --skill sound-effectsインストール後、Claude Code で/sound-effectsを入力して読み込まれたか確認します。
同梱ファイルreferences/installation.md
詳細
ElevenLabs Sound Effects
テキストの説明から効果音を生成します。ループ再生、カスタム再生時間、プロンプトへの追従度の調整に対応しています。
セットアップ: インストールガイドを参照してください。JavaScript では、
@elevenlabs/*パッケージのみを使用してください。
クイックスタート
Python
from elevenlabs import ElevenLabs
client = ElevenLabs()
audio = client.text_to_sound_effects.convert(
text="Thunder rumbling in the distance with light rain",
)
with open("thunder.mp3", "wb") as f:
for chunk in audio:
f.write(chunk)
JavaScript
import { ElevenLabsClient } from "@elevenlabs/elevenlabs-js";
import { createWriteStream } from "fs";
const client = new ElevenLabsClient();
const audio = await client.textToSoundEffects.convert({
text: "Thunder rumbling in the distance with light rain",
});
audio.pipe(createWriteStream("thunder.mp3"));
cURL
curl -X POST "https://api.elevenlabs.io/v1/sound-generation" \
-H "xi-api-key: $ELEVENLABS_API_KEY" -H "Content-Type: application/json" \
-d '{"text": "Thunder rumbling in the distance with light rain"}' \
--output thunder.mp3
パラメーター
| パラメーター | 型 | デフォルト | 説明 |
|---|---|---|---|
text | string(必須) | — | 生成する効果音の説明 |
model_id | string | eleven_text_to_sound_v2 | 使用するモデル |
duration_seconds | number | null | null(自動) | 再生時間は0.5~30秒です。nullの場合は自動計算されます |
prompt_influence | number | null | 0.3 | プロンプトへの追従度(0~1) |
loop | boolean | false | シームレスにループするサウンドを生成します(v2モデルのみ) |
パラメーターを使った例
# Looping ambient sound, 10 seconds
audio = client.text_to_sound_effects.convert(
text="Gentle forest ambiance with birds chirping",
duration_seconds=10.0,
prompt_influence=0.5,
loop=True,
)
# Short UI sound, high prompt adherence
audio = client.text_to_sound_effects.convert(
text="Soft notification chime",
duration_seconds=1.0,
prompt_influence=0.8,
)
出力形式
output_formatをクエリパラメーター(cURL)またはSDKパラメーターとして渡します。
| 形式 | 説明 |
|---|---|
mp3_44100_128 | MP3、44.1kHz、128kbps(デフォルト) |
pcm_44100 | CD品質の非圧縮生データ |
opus_48000_128 | Opus、48kHz、128kbps — 効率的な圧縮形式 |
ulaw_8000 | μ-law、8kHz — 電話音声 |
全形式:mp3_22050_32、mp3_24000_48、mp3_44100_32、mp3_44100_64、mp3_44100_96、mp3_44100_128、mp3_44100_192、pcm_8000、pcm_16000、pcm_22050、pcm_24000、pcm_32000、pcm_44100、pcm_48000、ulaw_8000、alaw_8000、opus_48000_32、opus_48000_64、opus_48000_96、opus_48000_128、opus_48000_192。
プロンプトのヒント
- 具体的に記述します:「トタン屋根に激しく降る雨」>「雨」
- 要素を組み合わせます:「砂利を踏む足音と遠くの交通音」
- スタイルを指定します:「シネマティックなブラーム、ホラー」または「8ビットのレトロなジャンプ音」
- 雰囲気や状況を伝えます:「廃墟の建物を吹き抜ける不気味な風のうなり」
エラー処理
try:
audio = client.text_to_sound_effects.convert(text="Explosion")
except Exception as e:
print(f"API error: {e}")
よくあるエラー:
- 401:APIキーが無効です
- 422:パラメーターが無効です(再生時間の範囲とprompt_influenceの範囲を確認してください)
- 429:レート制限を超過しました
参考資料
コメント
Markdown 対応