"""Base classes for TTS engines."""

from abc import ABC, abstractmethod
from dataclasses import dataclass
from pathlib import Path


@dataclass
class TTSResult:
    """Result of a synthesis operation."""

    audio_path: Path
    sample_rate: int
    duration_seconds: float
    engine: str
    voice: str


class TTSEngine(ABC):
    """Abstract base for TTS engines."""

    name: str = "unknown"
    default_voice: str = "default"

    @abstractmethod
    async def synthesize(self, text: str, voice: str | None = None) -> TTSResult:
        """Synthesize text to audio. Returns a TTSResult with the WAV file path."""

    @abstractmethod
    async def list_voices(self) -> list[str]:
        """Return available voice names."""

    @abstractmethod
    async def check_health(self) -> dict:
        """Check if the engine is operational. Returns status dict."""
