无法使用API访问elevenlabs语音

问题描述 投票:0回答:1

我想在使用 API 的项目中使用来自 Elevenlabs 的语音“Ryan Kurk”(语音 ID:

rU18Fk3uSDhmg5Xh41o4
),但由于某种原因 API 说该语音不可用。将鼠标悬停在网站上的 ID 上即可获取其 ID。

从elevenlabs获取语音ID:

Getting voice ID from elevenlabs

我已经按照 github 教程使用了elevenlabs python API 和

  1. 我安装了库
pip install elevenlabs==0.3.0b0
  1. 我实例化了客户端
from elevenlabs.client import ElevenLabs

client = ElevenLabs(api_key="...")
  1. 我已经构建了一个具有自定义设置的语音对象来个性化语音风格
from elevenlabs import Voice, VoiceSettings, generate

audio = generate(
    text="Hello! My name is Bella.",
    voice=Voice(
        voice_id=voice_id,
        settings=VoiceSettings(stability=0.71, similarity_boost=0.5, style=0.0, use_speaker_boost=True)
    )
)

play(audio)

哪里

voice_id=rU18Fk3uSDhmg5Xh41o4
。我收到以下错误:

ApiError: status_code: 400, body: {'detail': {'status': 'voice_not_found', 'message': 'A voice for the voice_id rU18Fk3uSDhmg5Xh41o4 was not found.'}}

我无法弄清楚为什么 API 无法识别该语音 ID,即使我可以在 11labs 的“语音合成”页面中使用该语音。

python text-to-speech elevenlabs
1个回答
0
投票

我认为您正在尝试访问语音库语音 ID。为此,您需要将该语音添加到您的语音实验室,之后它应该可以工作。

© www.soinside.com 2019 - 2024. All rights reserved.