#![allow(clippy::all, clippy::pedantic)]
use rust_tts_wrapper::create_engine;
fn main() -> Result<(), Box<dyn std::error::Error>> {
println!("Testing Rust TTS Wrapper API...\n");
println!("Test 1: Creating system engine...");
#[cfg(target_os = "windows")]
let native_engine_id = "sapi";
#[cfg(not(target_os = "windows"))]
let native_engine_id = "system";
let engine = create_engine(native_engine_id, "").expect("Failed to create engine");
println!("✅ Engine created successfully");
println!("\nTest 2: Getting available voices...");
let voices = engine.get_voices()?;
println!("✅ Found {} voices", voices.len());
println!("\nTest 3: Synthesizing audio to bytes...");
let audio = engine.synth_to_bytes("Hello, World!", None, 1.0, 1.0, 1.0)?;
println!("✅ Generated {} bytes of audio", audio.len());
println!("\nTest 4: Saving audio to file...");
std::fs::create_dir_all("examples/output")?;
std::fs::write("examples/output/test.wav", &audio)?;
println!("✅ Saved to examples/output/test.wav");
println!("\n🎯 All tests passed!");
Ok(())
}