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 numChannels(): number
  • Returns the channel count of audio frames returned by this TTS

    Returns number

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

    Returns number

Methods

  • Update the TTS options.

    Parameters

    • opts: {
          voiceName?: string;
      }

      Options to update

      • Optional voiceName?: string

    Returns void