Speechify text-to-speech over POST /v1/audio/stream/with-timestamps, which streams 24 kHz mono PCM together with word-level speech marks.

Hierarchy (view full)

Constructors

  • Create a new instance of Speechify TTS.

    Parameters

    Returns TTS

    Remarks

    apiKey must be set to your Speechify API key, either using the argument or by setting the SPEECHIFY_API_KEY environment variable.

    TTS.stream splits its input into sentences and synthesizes them one after another, each as one streamed request, and TTS.synthesize streams its whole text in one request. Requests share keep-alive connections, which TTS.prewarm opens ahead of the first one. Word timestamps come with the audio.

Properties

label: string = 'speechify.TTS'

Accessors

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

    Returns TTSCapabilities

  • get markup(): TTSMarkup
  • Access TTS markup capabilities (instructions for the LLM, text conversion).

    Returns TTSMarkup

  • 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

  • Open a connection to the Speechify API ahead of the first synthesis, so it does not pay for DNS, TCP and TLS setup. Sends an unauthenticated GET /health.

    Returns void