Skip to main content

Crate elevenlabs_sfx

Crate elevenlabs_sfx 

Source
Expand description

ElevenLabs Sound Effects API client

A type-safe, async Rust client for the ElevenLabs SFX API.

§Quick Start

use elevenlabs_sfx::ElevenLabsSFXClient;

#[tokio::main]
async fn main() -> Result<(), Box<dyn std::error::Error>> {
    let client = ElevenLabsSFXClient::new("your-api-key");
     
    let audio = client
        .sound_effects("Ghost Breath Wind")
        .output_format("mp3_44100_128")
        .duration_seconds(4.5)
        .prompt_influence(0.6)
        .execute()
        .await?;
     
    // audio is Vec<u8> - raw audio data
    std::fs::write("output.mp3", audio)?;
    Ok(())
}

Re-exports§

pub use error::ElevenLabsSFXError;
pub use types::*;

Modules§

error
types

Structs§

ElevenLabsSFXClient
Main client for interacting with ElevenLabs API
SoundEffectsBuilder
Builder for sound effects requests