我想在使用 API 的项目中使用来自 Elevenlabs 的语音“Ryan Kurk”(语音 ID:
rU18Fk3uSDhmg5Xh41o4
),但由于某种原因 API 说该语音不可用。将鼠标悬停在网站上的 ID 上即可获取其 ID。
从elevenlabs获取语音ID:
我已经按照 github 教程使用了elevenlabs python API 和
pip install elevenlabs==0.3.0b0
from elevenlabs.client import ElevenLabs
client = ElevenLabs(api_key="...")
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 的“语音合成”页面中使用该语音。
我认为您正在尝试访问语音库语音 ID。为此,您需要将该语音添加到您的语音实验室,之后它应该可以工作。