0.0.8 • Published 5 months ago
@lumiastream/say v0.0.8
Installing say.js
npm install sayUsage
// automatically pick platform
const say = require("say");
// or, override the platform
const Say = require("say").Say;
const say = new Say("darwin" || "win32" || "linux");
// Get voices
console.log(
"await say.getInstalledVoices();: ",
await say.getInstalledVoices()
);
// Use default system voice and speed
say.speak("Hello!");
// Stop the text currently being spoken
say.stop()(async () => {
// with a promise
try {
await say.speak({ text: "whats up, dog?", voice: "Good News", speed: 1.0 });
await say.speak({
text: "How are you today?",
voice: "Good News",
speed: 1.0,
});
} catch (error) {
console.log(error);
}
console.log("text to speech complete");
})();Methods
Speak:
- Speed: 1 = 100%, 0.5 = 50%, 2 = 200%, etc
say.speak(text, voice || null, speed || null, callback || null);Stop Speaking:
say.stop();Get List of Installed Voice(s):
const voices = await say.getInstalledVoices();0.0.8
5 months ago
0.0.7
5 months ago
0.0.6
5 months ago
0.0.5
5 months ago
0.0.5-alpha.2
5 months ago
0.0.5-alpha.1
5 months ago
0.0.4
5 months ago
0.0.3
6 months ago
0.0.2
6 months ago
0.0.1
6 months ago