"ElevenLabs" (サービス接続)
"ElevenLabs" (サービス接続)
このサービス接続には次が必要です:LLMアクセス »
接続と認証
ServiceConnect["ElevenLabs"]は,ElevenLabs APIへの接続を確立する.それまでに保存された接続が見付かった場合は,それが使われる.それ以外の場合は,新たな認証リクエストが起動される.
リクエスト
ServiceExecute["ElevenLabs","request",params]は,パラメータ params を使ってElevenLabs APIにリクエストを送る.次は可能なリクエストである.
音声合成
"ListVoices" — 音声合成に使用可能な声のリスト
"TextToSpeech" — テキストから音声を合成する
| "Text" | (required) | 音声合成するテキスト | |
| "Voice" | Automatic | 使用する声の名前または指定 | |
| "VoiceSettings" | Automatic | 使用する声の設定の連想 | |
| "ModelID" | Automatic | 使用するモデルの名前 | |
| "OptimizeStreamingLatency" | Automatic | 待ち時間を制御する0から4までの整数 |
例題
すべて開く すべて閉じる例 (1)
スコープ (3)
voice = RandomChoice[ServiceExecute["ElevenLabs", "ListVoices"]]ServiceExecute["ElevenLabs", "TextToSpeech", {"Text" -> "hello there!", "Voice" -> voice}]ServiceExecute["ElevenLabs", "TextToSpeech", {"Text" -> "hello there!", "Voice" -> voice["Name"]}]各結果はニューラルネットワークを使って作成されているので微妙に異なる.
ServiceExecute["ElevenLabs", "TextToSpeech", {"Text" -> "hello there!", "VoiceSettings" -> <|"similarity_boost" -> 1, "stability" -> 0, "style" -> 1|>}]"OptimizeStreamingLatency"パラメータを大きくすると品質は劣るが結果が速く得られる:
ServiceExecute["ElevenLabs", "TextToSpeech", {"Text" -> "hello there! This will be a longer sentence", "OptimizeStreamingLatency" -> 4}]//AbsoluteTimingServiceExecute["ElevenLabs", "TextToSpeech", {"Text" -> "hello there! This will be a longer sentence", "OptimizeStreamingLatency" -> 1}]//AbsoluteTiming