Class MsEdgeTTS

Constructors

Methods

  • Close the WebSocket connection.

    Returns void

  • 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[]>

  • Writes raw audio synthesised from text to a file. Has no SSML template. Basic SSML should be provided in the request.

    Parameters

    • dirPath: string

      a valid output directory path.

    • requestSSML: string

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

    Returns Promise<{
        audioFilePath: string;
        metadataFilePath: string;
    }>

    • a Promise with the full filepaths
  • Writes raw audio synthesised from a request in real-time to a Readable. Has no SSML template. Basic SSML should be provided in the request.

    Parameters

    • requestSSML: string

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

    Returns {
        audioStream: Readable;
        metadataStream: Readable;
    }

    • a Promise with the streams
    • audioStream: Readable
    • metadataStream: Readable
  • 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. Merges specified values into previously provided values.

    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. Changing the voiceName will reset the voiceLocale.

    • outputFormat: OUTPUT_FORMAT
    • Optional metadataOptions: MetadataOptions

      (optional) MetadataOptions

    Returns Promise<void>

  • Writes raw audio synthesised from text to a file. Uses a basic _SSMLTemplate SML template.

    Parameters

    • dirPath: string

      a valid output directory path

    • input: string

      the input to synthesise

    • Optional options: ProsodyOptions

      (optional) ProsodyOptions

    Returns Promise<{
        audioFilePath: string;
        metadataFilePath: string;
    }>

    • a Promise with the full filepaths
  • Writes raw audio synthesised from text in real-time to a Readable. Uses a basic _SSMLTemplate SML template.

    Parameters

    Returns {
        audioStream: Readable;
        metadataStream: Readable;
    }

    • a Promise with the streams
    • audioStream: Readable
    • metadataStream: Readable