An unofficial Rust API client for ElevenLabs text-to-speech software.

API Todos

| API | Support | | ---------- | ------- | | Edit Voice | ❌ |

⚙️ Requirements

🗣️ Usage

```rust use elevenlabs_rs::{Speech, Result};

[tokio::main]

async fn main() -> Result<()> { let speech = Speech::new( "This is the way the world ends, not with a bang but a whimper", "Clyde", "elevenmonolingualv1", 0, ).await?; speech.play()?; Ok(()) } ```

Multilingual Model

```rust use elevenlabs_rs::{Speech, Result};

[tokio::main]

async fn main() -> Result<()> { let speech = Speech::fromfile( "sonnet11.txt", "Glinda", "elevenmultilingualv1", 0, ).await?; speech.play()?; Ok(()) } ```

Voices

```rust use elevenlabsrs::{getvoices, Speech, Result};

[tokio::main]

async fn main() -> Result<()> { let voices = getvoices().await?; let clonedvoices = voices.all_clones();

let speech = Speech::new(
    "'I haven't the slightest idea', said the Hatter.",
    &cloned_voices[0].name,
    "eleven_monolingual_v1",
    0,
).await?;

speech.play()?;

println!("Voices: {:#?}", voices);

Ok(())

} ```

Clone Voice

```rust use elevenlabs_rs::{Result, Speech, VoiceCloneBuilder};

[tokio::main]

async fn main() -> Result<()> { let voiceclone = VoiceCloneBuilder::new() .name("Ishmael") // name method is required .description("A very squeaky voice") // description is optional .label("accent", "British") // label is optional .label("age", "young") .label("gender", "male") .file("sample1.mp3") // at least one file is required .file("sample_2.mp3") .build()?;

let voice = voice_clone.add().await?;

let speech = Speech::new(
    "I can move, I can talk, ....Am I a real boy?",
    &voice.name,
    "eleven_multilingual_v1",
    0,
)
.await?;

speech.play()?;

Ok(())

} ```