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

0.4.13 • Public • Published

Voice application plugin that accurately convert speech into text using an API powered by Google’s AI technologies.

Installation

npm install @fonoster/googleasr

or

yarn add @fonoster/googleasr

Usage

const { VoiceServer } = require("@fonoster/voice");
const GoogleASR = require("@fonoster/googleasr");
const voiceServer = new VoiceServer({ base: '/voiceapp' });

// Set the server to use the speech APIS
const speechConfig = { keyFilename: "./google.json" };
voiceServer.use(new GoogleASR(speechConfig));

voiceServer.listen(async(req, res) => {
  console.log(req);
  await res.answer();
  // To use this verb you MUST have a TTS plugin
  const speech = await res.gather();

  console.log("User input: " + speech");
  await res.hangup();
});

Readme

Keywords

none

Package Sidebar

Install

npm i @fonoster/googleasr

Weekly Downloads

20

Version

0.4.13

License

MIT

Unpacked Size

17 kB

Total Files

13

Last publish

Collaborators

  • fonoster-oss