pub mod locale_addenda;
pub mod normalize;
pub mod ssml;
pub mod store;
pub mod tts;
use thiserror::Error;
pub use locale_addenda::{default_voice_for_locale, language_style_addendum, voice_mode_addendum};
pub use store::{VoiceModeRow, VoiceModeStore, DEFAULT_VOICE_ID};
pub use tts::{
synthesize_voice_note, transcode_mp3_to_opus_ogg, EdgeTtsProvider, TtsProvider, VoiceNote,
EDGE_AUDIO_FORMAT, VOICE_NOTE_MIME,
};
pub type Result<T> = std::result::Result<T, VoiceError>;
#[non_exhaustive]
#[derive(Debug, Error)]
pub enum VoiceError {
#[error("sqlite: {0}")]
Sqlite(#[from] sqlx::Error),
#[error("edge: {0}")]
Edge(String),
#[error("ffmpeg: {0}")]
Ffmpeg(String),
#[error("empty text — nothing to synthesize")]
EmptyText,
#[error("empty voice_id")]
EmptyVoiceId,
#[error("synthesis returned 0 bytes (provider flake)")]
EmptySynthesis,
}