rw-integrate-audio
作者: runwayml
幫助用戶整合 Runway 音頻 API(文字轉語音、音效、語音隔離、配音)
npx skills add https://github.com/runwayml/skills --skill rw-integrate-audioIntegrate Audio Generation
PREREQUISITE: Run
+rw-check-compatibilityfirst. Run+rw-fetch-api-referenceto load the latest API reference before integrating. Requires+rw-setup-api-keyfor API credentials. Requires+rw-integrate-uploadsfor local audio/video files.
Help users add Runway audio generation to their server-side code.
Available Models
| Model | Endpoint | Use Case | Cost |
|---|---|---|---|
eleven_multilingual_v2 | POST /v1/text_to_speech | Text to speech | 1 credit/50 chars |
eleven_text_to_sound_v2 | POST /v1/sound_effect | Sound effect generation | 1-2 credits |
eleven_voice_isolation | POST /v1/voice_isolation | Isolate voice from audio | 1 credit/6 sec |
eleven_voice_dubbing | POST /v1/voice_dubbing | Dub audio to other languages | 1 credit/2 sec |
eleven_multilingual_sts_v2 | POST /v1/speech_to_speech | Voice conversion | 1 credit/3 sec |
Text-to-Speech
Generate speech from text using the ElevenLabs multilingual model.
Node.js SDK
import RunwayML from '@runwayml/sdk';
const client = new RunwayML();
const task = await client.textToSpeech.create({
model: 'eleven_multilingual_v2',
promptText: 'Hello, welcome to our application!',
voice: { type: 'runway-preset', presetId: 'Maya' }
}).waitForTaskOutput();
const audioUrl = task.output[0];
Python SDK
from runwayml import RunwayML
client = RunwayML()
task = client.text_to_speech.create(
model='eleven_multilingual_v2',
prompt_text='Hello, welcome to our application!',
voice={ 'type': 'runway-preset', 'presetId': 'Maya' }
).wait_for_task_output()
audio_url = task.output[0]
Sound Effects
Generate sound effects from text descriptions.
const task = await client.soundEffect.create({
model: 'eleven_text_to_sound_v2',
promptText: 'Thunder rolling across a stormy sky'
}).waitForTaskOutput();
task = client.sound_effect.create(
model='eleven_text_to_sound_v2',
prompt_text='Thunder rolling across a stormy sky'
).wait_for_task_output()
Voice Isolation
Extract voice from audio with background noise.
// If using a local file, upload first
const upload = await client.uploads.createEphemeral(
fs.createReadStream('/path/to/noisy-audio.mp3')
);
const task = await client.voiceIsolation.create({
model: 'eleven_voice_isolation',
audioUri: upload.runwayUri
}).waitForTaskOutput();
Voice Dubbing
Dub audio/video into other languages.
const task = await client.voiceDubbing.create({
model: 'eleven_voice_dubbing',
audioUri: 'https://example.com/speech.mp3',
targetLang: 'es' // Spanish
}).waitForTaskOutput();
Speech-to-Speech
Convert one voice to another.
const task = await client.speechToSpeech.create({
model: 'eleven_multilingual_sts_v2',
media: { type: 'audio', uri: 'https://example.com/original-speech.mp3' },
voice: { type: 'runway-preset', presetId: 'Noah' }
}).waitForTaskOutput();
Integration Pattern
Express.js — Text-to-Speech Endpoint
import RunwayML from '@runwayml/sdk';
import express from 'express';
const client = new RunwayML();
const app = express();
app.use(express.json());
app.post('/api/text-to-speech', async (req, res) => {
try {
const { text, voiceId } = req.body;
const task = await client.textToSpeech.create({
model: 'eleven_multilingual_v2',
promptText: text,
voice: { type: 'runway-preset', presetId: voiceId || 'Maya' }
}).waitForTaskOutput();
res.json({ audioUrl: task.output[0] });
} catch (error) {
console.error('TTS failed:', error);
res.status(500).json({ error: error.message });
}
});
FastAPI — Sound Effects
from fastapi import FastAPI, HTTPException
from pydantic import BaseModel
from runwayml import RunwayML
app = FastAPI()
client = RunwayML()
class SoundRequest(BaseModel):
prompt: str
@app.post("/api/sound-effect")
async def generate_sound(req: SoundRequest):
try:
task = client.sound_effect.create(
model='eleven_text_to_sound_v2',
prompt_text=req.prompt
).wait_for_task_output()
return {"audio_url": task.output[0]}
except Exception as e:
raise HTTPException(status_code=500, detail=str(e))
Tips
- Output URLs expire in 24-48 hours. Download audio files to your own storage.
- For local audio files (voice isolation, dubbing, speech-to-speech), upload via
+rw-integrate-uploadsfirst. - Voice IDs can be listed via the voices endpoint — see
+rw-api-referencefor details. - Text-to-speech cost scales with text length: 1 credit per 50 characters.
來自 runwayml 的更多技能
recipe-full-setup
runwayml
完成 Runway API 設定:檢查相容性、配置 API 金鑰,並整合生成端點
official
integrate-character-embed
runwayml
幫助使用者透過 @runwayml/avatars-react SDK 在 React 應用程式中嵌入 Runway Character 虛擬人像通話功能
official
integrate-characters
runwayml
幫助用戶創建 Runway Characters(GWM-1 頭像),並將即時對話會話整合到他們的應用程式中
official
integrate-documents
runwayml
幫助用戶將知識庫文件添加到 Runway Characters 中,以進行特定領域的對話
official
integrate-image
runwayml
幫助用戶整合 Runway 圖片生成 API(使用參考圖片的文字轉圖片功能)
official
integrate-uploads
runwayml
幫助用戶將本地檔案上傳至 Runway,作為生成模型的輸入使用。
official
integrate-video
runwayml
幫助使用者整合 Runway 影片生成 API(文字轉影片、圖片轉影片、影片轉影片)
official
runway-studio-skills
runwayml
使用 Runway API 生成工作室品質的影片、圖片和音訊。所有指令均為獨立的 Python 腳本,透過從技能根目錄執行 uv run 來運行。
official