//! # LiveSpeech SDK
//!
//! A Rust SDK for real-time speech-to-speech AI conversations.
//!
//! ## Quick Start
//!
//! ```rust,no_run
//! use livespeech_sdk::{LiveSpeechClient, Config, Region, SessionConfig, LiveSpeechEvent};
//!
//! #[tokio::main]
//! async fn main() -> Result<(), Box<dyn std::error::Error>> {
//!     // Create configuration
//!     let config = Config::builder()
//!         .region(Region::ApNortheast2)
//!         .api_key("your-api-key")
//!         .build()?;
//!
//!     // Create client
//!     let client = LiveSpeechClient::new(config);
//!
//!     // Subscribe to events (recommended)
//!     let mut events = client.subscribe();
//!     tokio::spawn(async move {
//!         while let Ok(event) = events.recv().await {
//!             match event {
//!                 LiveSpeechEvent::Ready(_) => println!("Ready for audio"),
//!                 LiveSpeechEvent::UserTranscript(e) => println!("You said: {}", e.text),
//!                 LiveSpeechEvent::Response(e) => println!("AI: {}", e.text),
//!                 LiveSpeechEvent::Audio(e) => println!("Audio: {} bytes", e.data.len()),
//!                 LiveSpeechEvent::TurnComplete(_) => println!("Turn complete"),
//!                 LiveSpeechEvent::Error(e) => eprintln!("Error: {}", e.message),
//!                 _ => {}
//!             }
//!         }
//!     });
//!
//!     // Connect and start session
//!     client.connect().await?;
//!     let session_id = client.start_session(Some(
//!         SessionConfig::new("You are a helpful assistant.")
//!     )).await?;
//!     println!("Session: {}", session_id);
//!
//!     // Stream audio
//!     client.audio_start().await?;
//!     let audio_chunk: Vec<u8> = vec![0u8; 3200]; // PCM16 audio
//!     client.send_audio_chunk(&audio_chunk).await?;
//!     client.audio_end().await?;
//!
//!     // Cleanup
//!     client.end_session().await?;
//!     client.disconnect().await;
//!
//!     Ok(())
//! }
//! ```

pub mod audio;
pub mod client;
pub mod error;
pub mod types;

// Re-export main types for convenience
pub use client::{ConnectionState, LiveSpeechClient};
pub use error::{LiveSpeechError, Result};
pub use types::{
    // Config types
    Config, ConfigBuilder, ConfigError, FunctionParameters, PipelineMode, Region, SessionConfig,
    SessionDurationConfig, Tool,
    // Event types
    AudioEvent, AudioHandler, ConnectedEvent, DisconnectedEvent, DisconnectReason, ErrorCode,
    ErrorEvent, ErrorHandler, LiveSpeechEvent, ReadyEvent, ReconnectingEvent, ResponseEvent,
    ResponseHandler, SessionEndedEvent, SessionStartedEvent, ToolCallEvent, TurnCompleteEvent,
    UserTranscriptEvent,
    // Message types
    ClientMessage, ServerMessage, StartSessionParams, ToolResponsePayload,
};

// Re-export audio utilities
pub use audio::{
    bytes_to_int16, create_wav_header, decode_from_base64, encode_to_base64, float32_to_int16,
    int16_to_bytes, int16_to_float32, wrap_pcm_in_wav, AudioEncoder,
};
