Options
All
  • Public
  • Public/Protected
  • All
Menu

Class MsEdgeTTS

Hierarchy

  • MsEdgeTTS

Index

Constructors

  • new MsEdgeTTS(agent?: Agent, enableLogger?: boolean): MsEdgeTTS

Properties

OUTPUT_FORMAT: typeof OUTPUT_FORMAT = OUTPUT_FORMAT

Methods

  • close(): void
  • getVoices(): Promise<Voice[]>
  • Fetch the list of voices available in Microsoft Edge. These, however, are not all. The complete list of voices supported by this module can be found here (neural, standard, and preview).

    Returns Promise<Voice[]>

  • rawToFile(path: string, requestSSML: string): Promise<string>
  • Writes raw audio synthesised from text to a file. Has no SSML template. Basic SSML should be provided in the request.

    Parameters

    • path: string

      a valid output path, including a filename and file extension.

    • requestSSML: string

      the SSML to send. SSML elements required in order to work.

    Returns Promise<string>

    • a Promise with the full filepath
  • rawToStream(requestSSML: any): Readable
  • Writes raw audio synthesised from a request in real-time to a {@link stream.Readable}. Has no SSML template. Basic SSML should be provided in the request.

    Parameters

    • requestSSML: any

      the SSML to send. SSML elements required in order to work.

    Returns Readable

    • a stream.Readable with the audio data
  • setMetadata(voiceName: string, outputFormat: OUTPUT_FORMAT, voiceLocale?: string): Promise<void>
  • Sets the required information for the speech to be synthesised and inits a new WebSocket connection. Must be called at least once before text can be synthesised. Saved in this instance. Can be called at any time times to update the metadata.

    Parameters

    • voiceName: string

      a string with any ShortName. A list of all available neural voices can be found here. However, it is not limited to neural voices: standard voices can also be used. A list of standard voices can be found here

    • outputFormat: OUTPUT_FORMAT
    • Optional voiceLocale: string

      (optional) any voice locale that is supported by the voice. See the list of all voices for compatibility. If not provided, the locale will be inferred from the voiceName

    Returns Promise<void>

  • toFile(path: string, input: string, options?: ProsodyOptions): Promise<string>
  • Writes raw audio synthesised from text to a file. Uses a basic {@link _SSMLTemplate SML template}.

    Parameters

    • path: string

      a valid output path, including a filename and file extension.

    • input: string

      the input to synthesise

    • Optional options: ProsodyOptions

      (optional) ProsodyOptions

    Returns Promise<string>

    • a Promise with the full filepath
  • Writes raw audio synthesised from text in real-time to a {@link stream.Readable}. Uses a basic {@link _SSMLTemplate SML template}.

    Parameters

    Returns Readable

    • a stream.Readable with the audio data

Generated using TypeDoc