Files
audio-engine-hub/app/config.py
stephan fff0252d52 feat: Add OpenAI-compatible TTS endpoint and engines
- 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.
2025-12-09 12:45:17 +01:00

41 lines
1.2 KiB
Python
Raw Permalink 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
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()