@fonoster/pollytts
TypeScript icon, indicating that this package has built-in type declarations

0.4.13 • Public • Published

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

Installation

npm install @fonoster/pollytts

or

yarn add @fonoster/pollytts

Usage

const { VoiceServer } = require("@fonoster/voice");
const PollyTTS, { Voice } = require("@fonoster/pollytts");

const voiceServer = new VoiceServer();

// Set the server to use Polly
const speechConfig = { keyFilename: "./amazon.json" };
voiceServer.use(new PollyTTS(speechConfig));

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

Readme

Keywords

none

Package Sidebar

Install

npm i @fonoster/pollytts

Weekly Downloads

2

Version

0.4.13

License

MIT

Unpacked Size

122 kB

Total Files

16

Last publish

Collaborators

  • fonoster-oss