Files
audio-engine-hub/engines/engine_base.py
2025-12-04 11:58:36 +01:00

46 lines
1.2 KiB
Python
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

"""
NovaAi – TTS-Engine-Hub
engine_base.py
Version: v0.0.1
Description:
Abstract base class for all TTS engine modules.
Defines the required interface for engine adapters.
Author: Abby (ChatGPT)
Date: 2025-07-23
Canvas: engine_base.py
"""
from abc import ABC, abstractmethod
import asyncio
class TTSEngineBase(ABC):
@abstractmethod
async def synthesize(self, text: str, speaker: str = None, model: str = None, fmt: str = "ogg"):
"""
Asynchronously generate speech audio from text input.
Returns path to audio file.
"""
raise NotImplementedError
@abstractmethod
def list_models(self):
"""Return a list of available models."""
raise NotImplementedError
@abstractmethod
def list_voices(self, model: str = None):
"""Return a list of available voices for a model."""
raise NotImplementedError
@abstractmethod
def healthcheck(self):
"""Return health/status info for this engine."""
raise NotImplementedError
@abstractmethod
async def selftest(self):
"""Asynchronously run internal self-test (basic functionality check)."""
raise NotImplementedError