npm.io
0.4.13 • Published 2 years ago

@fonoster/googletts

Licence
MIT
Version
0.4.13
Deps
5
Size
8 kB
Vulns
0
Weekly
0
Stars
8.2K
DeprecatedThis package is deprecated

Voice application plugin that converts text into natural-sounding speech using an API powered by Google’s AI technologies.

Installation

npm install @fonoster/googletts

or

yarn add @fonoster/googletts

Usage

const { VoiceServer } = require("@fonoster/voice");
const GoogleTTS = require("@fonoster/googletts");

const voiceServer = new VoiceServer({ base: '/voiceapp' });

// Set the server to use Google's TTS
const speechConfig = { keyFilename: "./google.json" };
voiceServer.use(new GoogleTTS(speechConfig));

voiceServer.listen(async(req, res) => {
  console.log(req);
  await res.answer();
  await res.say("Hi! This is google text to speech");
  await res.hangup();
});