tjbot-ce - v3.0.0
    Preparing search index...

    Interface TTSEngineAbstract

    Abstract Text-to-Speech Engine Base Class

    Defines the interface for TTS backends (IBM Watson, sherpa-onnx, etc.) All implementations must extend this class and implement the required methods.

    interface TTSEngine {
        cleanup?(): Promise<void>;
        initialize(): Promise<void>;
        synthesize(text: string): Promise<Buffer<ArrayBufferLike>>;
    }
    Index

    Methods

    • Clean up resources used by the TTS engine. Optional method for backends that need to release resources.

      Returns Promise<void>

    • Initialize the TTS engine. Must be called before synthesize().

      Returns Promise<void>

      if initialization fails

    • Synthesize text to WAV audio. Both backends should validate input text and return audio as a Buffer in WAV format. Voice is configured at engine initialization time and cannot be changed per synthesis call.

      Parameters

      • text: string

        Text to synthesize

      Returns Promise<Buffer<ArrayBufferLike>>

      WAV audio buffer

      if synthesis fails