The macOS built-in `say` CLI for JavaScript
npm install mac-sayThe macOS built-in say CLI for JavaScript
``shell`
npm i mac-say
`javascript
import { say } from "mac-say";
await say("Hello, world!");
await say("Hello! My name is Cellos.", { voice: "Cellos" });
`
#### text
Type: string
The content to be converted to audible speech.
#### options
Type: SayOptions
Optional. All available options are listed below:
`typescript`
type SayOptions = {
voice?: string;
rate?: number;
audioDevice?: string;
quality?: number;
inputFile?: string;
outputFile?: string;
networkSend?: string;
channels?: number;
skipRunningCheck?: boolean;
};
Please refer to man say for usage of all options.
To obtain a list of audio output devices.
Returns a [Promise][types].
To obtain a list of audio data formats for a file format specified explicitly or by file name.
Returns a [Promise][types].
#### fileForamt
Type: string
Formats other than linear PCM are specified by giving their format identifiers (aac, alac).
To obtain a list of writable file formats.
Returns a [Promise][types].
To obtain a list of voices installed in the system.
Returns a [Promise][types].
To obtain the information of the say process.
Returns a Promise
To kill the say process if it's running.
- Say - Spoken Content - macOS built-in Spoken Content interface
MIT
[types]: https://github.com/LitoMore/mac-say/blob/main/source/types.ts