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 在 音频
97 每月下载量
用于 reddit-motion
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