The Windows built-in text-to-speech interface for JavaScript
npm i @litomore/win-sayimport { say } from "@litomore/win-say";
await say("Hello, world!");
await say("Hello! My name is David.", { voice: "Microsoft David Desktop" });Type: string
The content to be converted to audible speech.
Type: SayOptions
Optional. All available options are listed below:
type SayOptions = {
voice?: string;
rate?: number;
volume?: number;
outputFile?: string;
skipRunningCheck?: boolean;
};rate maps to the Windows SpeechSynthesizer range of -10 to 10.
volume maps to the Windows SpeechSynthesizer range of 0 to 100.
outputFile writes a WAV file instead of speaking through the default audio device.
To obtain the default audio output device placeholder.
Returns a Promise<Device[]>.
Windows SpeechSynthesizer speaks through the system default output device and does not expose per-device selection through this API.
To obtain a list of audio data formats for a file format specified explicitly or by file name.
Returns a Promise<DataFormat[]>.
Windows SpeechSynthesizer writes WAV output with PCM audio data.
Type: string
To obtain a list of writable file formats.
Returns a Promise<FileFormat[]>.
Windows SpeechSynthesizer writes WAV output.
To obtain a list of voices installed in the system.
Returns a Promise<Voice[]>.
To obtain the information of the active win-say PowerShell process.
Returns a Promise<DefaultTask | undefined>.
To kill the active win-say PowerShell process if it's running.
MIT