Speech Provider - v0.1.4
    Preparing search index...

    Interface VoiceProvider

    Interface for a voice provider that can synthesize speech. A voice provider can be either the browser's built-in speech synthesis or an external service like ElevenLabs.

    interface VoiceProvider {
        getDefaultVoice(options: { lang: string }): Promise<null | Voice>;
        getVoices(options: { lang: string; minVoices: number }): Promise<Voice[]>;
        name: string;
    }

    Implemented by

    Index

    Properties

    Methods

    Properties

    name: string

    The name of the voice provider

    Methods

    • Get the default voice for a given language code.

      Parameters

      • options: { lang: string }

        The options for getting the default voice

        • lang: string

          The language code to match

      Returns Promise<null | Voice>

      The default voice for the language, or null if none is available

    • Get the voices for a given language code.

      Parameters

      • options: { lang: string; minVoices: number }

        The options for getting voices

        • lang: string

          The language code to match

        • minVoices: number

          The minimum number of voices to return

      Returns Promise<Voice[]>

      The voices for the given language code