Skip to content

rwxbytes/elevenlabs_rs

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

51 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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