6 releases

0.3.2 Nov 3, 2024
0.3.1 Jul 11, 2024
0.3.0 Jun 28, 2024
0.2.0 Aug 9, 2023
0.1.1 Aug 8, 2023

#274 in Audio

Download history 12/week @ 2024-08-17 10/week @ 2024-08-24 12/week @ 2024-08-31 1/week @ 2024-09-07 45/week @ 2024-09-14 38/week @ 2024-09-21 2/week @ 2024-09-28 1/week @ 2024-10-26 131/week @ 2024-11-02 31/week @ 2024-11-09 25/week @ 2024-11-16 5/week @ 2024-11-23 29/week @ 2024-11-30

99 downloads per month
Used in reddit-motion

MIT license

180KB
4K SLoC

An unofficial lib crate for ElevenLabs

Text-to-Speech

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:

An unofficial lib crate for ElevenLabs.

ElevenLabs' web app: https://elevenlabs.io/

ElevenLabs' API documentation: https://docs.elevenlabs.io/api-reference/quick-start/introduction.

Example

Text to Speech

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(())
}

Dependencies

~8–41MB
~651K SLoC