alltalk 0.1.0

A client for the AllTalk API
Documentation
use std::path::Path;

#[tokio::main]
async fn main() -> anyhow::Result<()> {
    let alltalk_client = alltalk::AllTalkClient::from_environment()?;
    let is_ready = alltalk_client.is_ready().await?;
    if is_ready {
        println!("AllTalk is ready");
    } else {
        println!("AllTalk is not ready");
    }
    let voices = alltalk_client.get_voices().await?;
    println!("Voices: {:?}", voices);

    let current_settings = alltalk_client.get_current_settings().await?;
    println!("Current settings: {:?}", current_settings);

    let voice = "Albus Dumbledore.wav";
    let text = "Hello, this is a test.";
    let language = alltalk::Language::English;
    let tts_generation_request = alltalk::TTSModelOptions {
        text_input: text.to_string(),
        character_voice_gen: voice.to_string(),
        language,
        ..Default::default()
    };
    let tts_generation_response = alltalk_client.generate_tts(&tts_generation_request).await?;
    println!("TTS Generation Response: {:?}", tts_generation_response);
    // we download the file
    let output_file_path = tts_generation_response.output_file_url;
    let destination_path = Path::new("/tmp")
        .join("output.wav")
        .to_string_lossy()
        .to_string();
    alltalk_client
        .download_file(&output_file_path, &destination_path)
        .await?;

    println!("Finished.");
    Ok(())
}