Expand description
An unofficial lib crate for ElevenLabs.
§Example
§Text to Speech
use elevenlabs_rs::{ElevenLabsClient, Result, DefaultVoice, Model};
use elevenlabs_rs::endpoints::genai::tts::{TextToSpeech, TextToSpeechBody};
use elevenlabs_rs::utils::play;
#[tokio::main]
async fn main() -> Result<()> {
let client = ElevenLabsClient::from_env()?;
let txt = "Hello! 你好! Hola! नमस्ते! Bonjour! \
こんにちは! مرحبا! 안녕하세요! Ciao! Cześć! Привіт! வணக்கம்!";
let body = TextToSpeechBody::new(txt)
.with_model_id(Model::ElevenMultilingualV2);
let endpoint = TextToSpeech::new(DefaultVoice::Brian, body);
let speech = client.hit(endpoint).await?;
play(speech)?;
Ok(())
}
Modules§
Macros§
- pin_mut
- Pins a value on the stack.
Structs§
- Bytes
- A cheaply cloneable and sliceable chunk of contiguous memory.
- Eleven
Labs Client - Voice
Settings - Voice settings
Enums§
- Default
Voice - Language
- Language
- Legacy
Voice - Model
- Output
Format - See Elevenlabs documentation on supported output formats.
Traits§
- Stream
Ext - An extension trait for
Stream
s that provides a variety of convenient combinator functions.