- Implements POST /v1/audio/speech endpoint (OpenAI API compatible). - Integrates Kokoro and XTTS engines (including dependencies and implementations). - Updates main application to register new engines and router. - Adds unit tests for OpenAI compatibility. - Updates requirements.txt for new engines.
41 lines
1.2 KiB
Python
41 lines
1.2 KiB
Python
"""
|
||
NovaAi – TTS-Engine-Hub
|
||
config.py
|
||
Version: v0.0.1
|
||
|
||
Description:
|
||
Centralized configuration management using pydantic-settings.
|
||
Loads settings from a .env file and environment variables.
|
||
"""
|
||
from pydantic_settings import BaseSettings, SettingsConfigDict
|
||
from typing import List, Set
|
||
|
||
class Settings(BaseSettings):
|
||
# Server Configuration
|
||
HOST: str = "0.0.0.0"
|
||
PORT: int = 8000
|
||
|
||
# Application Configuration
|
||
ACTIVE_ENGINES: Set[str] = {"piper"}
|
||
ASSET_DIR: str = "app/asset"
|
||
AUDIO_CACHE_DIR: str = "app/asset/audio"
|
||
MODELS_DIR: str = "app/models"
|
||
LOG_LEVEL: str = "INFO" # Added log level setting
|
||
|
||
# Piper Engine Timeouts (in seconds)
|
||
PIPER_TIMEOUT_SECONDS: int = 30
|
||
FFMPEG_TIMEOUT_SECONDS: int = 60
|
||
|
||
# Kokoro Engine Configuration
|
||
KOKORO_DEVICE: str = "cuda" # or "cpu"
|
||
KOKORO_TIMEOUT_SECONDS: int = 30
|
||
|
||
# Coqui XTTS Engine Configuration
|
||
XTTS_DEVICE: str = "cuda" # or "cpu"
|
||
XTTS_ACCEPT_LICENSE: bool = False # User must opt-in
|
||
VOICES_DIR: str = "app/asset/voices" # Directory for reference speaker wavs
|
||
|
||
model_config = SettingsConfigDict(env_file=".env", env_file_encoding='utf-8')
|
||
|
||
settings = Settings()
|