#text-to-speech #ai #tts #elevenlabs #voice-clone

bin+lib elevenlabs_rs

ElevenLabs 的 lib crate

5 个不稳定版本

0.3.1 2024 年 7 月 11 日
0.3.0 2024 年 6 月 28 日
0.2.0 2023 年 8 月 9 日
0.1.1 2023 年 8 月 8 日
0.1.0 2023 年 8 月 7 日

#231音频

Download history 2/week @ 2024-06-03 129/week @ 2024-06-24 42/week @ 2024-07-01 138/week @ 2024-07-08 5/week @ 2024-07-15 69/week @ 2024-07-29 13/week @ 2024-08-05

97 每月下载量
用于 reddit-motion

MIT 许可证

5MB
4K SLoC

ElevenLabs 的非官方 lib crate

文本到语音

use elevenlabs_rs::*;
use elevenlabs_rs::utils::play;

#[tokio::main]
async fn main() -> Result<()> {
    let client = ElevenLabsClient::default()?;
    let body = TextToSpeechBody::new(
        "This is the way the world ends, not with a bang but a whimper",
        Model::ElevenMultilingualV2,
    );
    let endpoint = TextToSpeech::new(PreMadeVoiceID::Clyde, body);
    let speech = client.hit(endpoint).await?;
    play(speech)?;

    Ok(())
}

lib.rs:

ElevenLabs 的非官方 lib crate

ElevenLabs 的网页应用:https://elevenlabs.io/

ElevenLabs 的 API 文档:https://docs.elevenlabs.io/api-reference/quick-start/introduction.

示例

文本到语音

use elevenlabs_rs::*;
use elevenlabs_rs::utils::play;

#[tokio::main]
async fn main() -> Result<()> {
    let client = ElevenLabsClient::default()?;
    let body = TextToSpeechBody::new(
        "This is the way the world ends, not with a bang but a whimper",
        Model::ElevenMultilingualV2,
    );
    let endpoint = TextToSpeech::new(PreMadeVoiceID::Clyde, body);
    let speech = client.hit(endpoint).await?;
    play(speech)?;

    Ok(())
}

依赖项

~8–40MB
~673K SLoC