An instance of a text-to-speech adapter.

Remarks

This class is abstract, and as such cannot be used directly. Instead, use a provider plugin that exports its own child TTS class, which inherits this class's methods.

Hierarchy (view full)

Constructors

  • Create a new instance of Gemini TTS.

    Environment Requirements:

    • For VertexAI: Set the GOOGLE_APPLICATION_CREDENTIALS environment variable to the path of the service account key file.
    • For Google Gemini API: Set the apiKey argument or the GOOGLE_API_KEY environment variable.

    Parameters

    • opts: Partial<beta.TTSOptions & {
          apiKey: string;
      }> = {}

      Configuration options for Gemini TTS

    Returns beta.TTS

Properties

label: string = 'google.gemini.TTS'

Accessors

  • get capabilities(): TTSCapabilities
  • Returns this TTS's capabilities

    Returns TTSCapabilities

  • get model(): string
  • Get the model name/identifier for this TTS instance.

    Returns string

    The model name if available, "unknown" otherwise.

    Remarks

    Plugins should override this property to provide their model information.

  • get numChannels(): number
  • Returns the channel count of audio frames returned by this TTS

    Returns number

  • get provider(): string
  • Get the provider name for this TTS instance.

    Returns string

    The provider name if available, "unknown" otherwise.

    Remarks

    Plugins should override this property to provide their provider information.

  • get sampleRate(): number
  • Returns the sample rate of audio frames returned by this TTS

    Returns number

Methods

  • Returns Promise<void>

  • Update the TTS options.

    Parameters

    • opts: {
          voiceName?: string;
      }

      Options to update

      • Optional voiceName?: string

    Returns void