first commit
This commit is contained in:
45
engines/engine_base.py
Normal file
45
engines/engine_base.py
Normal file
@ -0,0 +1,45 @@
|
||||
"""
|
||||
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
|
||||
Reference in New Issue
Block a user