New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

@fonos/voice

Package Overview
Dependencies
Maintainers
1
Versions
158
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@fonos/voice - npm Package Compare versions

Comparing version 0.1.15-alpha.0 to 0.1.16-alpha.0

dist/sgather/gather.d.ts

2

dist/gather/source_speech.js

@@ -45,3 +45,3 @@ "use strict";

clearTimeout(timer);
resolve(result.transcription);
resolve(result.transcript);
})

@@ -48,0 +48,0 @@ .catch(reject)

@@ -9,2 +9,4 @@ import { GatherOptions } from "./gather/gather";

import { Plugin } from "@fonos/common";
import { SGatherOptions } from "./sgather/gather";
import { SGatherStream } from "./sgather/types";
/**

@@ -89,3 +91,3 @@ * @classdesc Use the VoiceResponse object, to construct advance Interactive

* @param {string} options.source - Where to listen as input source. This option accepts `dtmf` and `speech`. A speech provider must be configure
* when including the `speech` option. You might inclue both with `dtmf,speech`. Defaults to `dtmf`
* when including the `speech` source. You might inclue both with `dtmf,speech`. Defaults to `dtmf`
* @note When including `speech` the default timeout is 10000 (10s).

@@ -102,2 +104,28 @@ * @see SpeechProvider

/**
* Waits for data entry from the user's keypad or from a stream speech provider. This command is different than `gather`
* in that it returns a stream of results instead of a single result. You can think of it as active listening.
*
* @param {SGatherOptions} options - Options to select the
* @param {string} options.source - Where to listen as input source. This option accepts `dtmf` and `speech`. A speech provider must be configure
* when including the `speech` source. You might inclue both with `dtmf,speech`. Defaults to `speech,dtmf`
* @return {SGatherStream} The SGatherStream fires events via am `on` method for `transcription`, `dtmf`, and `error`. And the stream can be close
* with the `close` function.
* @see StreamSpeechProvider
* @example
*
* async function handler (request, response) {
* const stream = await response.sgather({source: "dtmf,speech"});
*
* stream.on("transcript", (text, isFinal) => {
* console.log("transcript: %s", text);
* })
*
* stream.on("dtmf", digit => {
* console.log("digit: " + digit);
* if (digit === "#") stream.close();
* })
* }
*/
sgather(options: SGatherOptions): Promise<SGatherStream>;
/**
* Returns a PlaybackControl control object.

@@ -104,0 +132,0 @@ *

@@ -35,2 +35,3 @@ "use strict";

const utils_1 = require("./utils");
const gather_2 = __importDefault(require("./sgather/gather"));
/**

@@ -127,3 +128,3 @@ * @classdesc Use the VoiceResponse object, to construct advance Interactive

* @param {string} options.source - Where to listen as input source. This option accepts `dtmf` and `speech`. A speech provider must be configure
* when including the `speech` option. You might inclue both with `dtmf,speech`. Defaults to `dtmf`
* when including the `speech` source. You might inclue both with `dtmf,speech`. Defaults to `dtmf`
* @note When including `speech` the default timeout is 10000 (10s).

@@ -147,2 +148,35 @@ * @see SpeechProvider

/**
* Waits for data entry from the user's keypad or from a stream speech provider. This command is different than `gather`
* in that it returns a stream of results instead of a single result. You can think of it as active listening.
*
* @param {SGatherOptions} options - Options to select the
* @param {string} options.source - Where to listen as input source. This option accepts `dtmf` and `speech`. A speech provider must be configure
* when including the `speech` source. You might inclue both with `dtmf,speech`. Defaults to `speech,dtmf`
* @return {SGatherStream} The SGatherStream fires events via am `on` method for `transcription`, `dtmf`, and `error`. And the stream can be close
* with the `close` function.
* @see StreamSpeechProvider
* @example
*
* async function handler (request, response) {
* const stream = await response.sgather({source: "dtmf,speech"});
*
* stream.on("transcript", (text, isFinal) => {
* console.log("transcript: %s", text);
* })
*
* stream.on("dtmf", digit => {
* console.log("digit: " + digit);
* if (digit === "#") stream.close();
* })
* }
*/
async sgather(options) {
let asr = null;
if (options.source.includes("speech")) {
asserts_1.assertPluginExist(this, "asr");
asr = this.plugins["asr"];
}
return await new gather_2.default(this.request, asr).run(options);
}
/**
* Returns a PlaybackControl control object.

@@ -149,0 +183,0 @@ *

{
"name": "@fonos/voice",
"version": "0.1.15-alpha.0",
"version": "0.1.16-alpha.0",
"description": "Voice verbs",

@@ -32,7 +32,2 @@ "author": "Pedro Sanders <psanders@fonoster.com>",

"dependencies": {
"@fonos/common": "^0.1.14-alpha.0",
"@fonos/events": "^0.1.11-alpha.3",
"@fonos/googleasr": "^0.1.14-alpha.1",
"@fonos/logger": "^0.1.11-alpha.3",
"@fonos/tts": "^0.1.11-alpha.3",
"axios": "^0.21.1",

@@ -46,3 +41,3 @@ "deepmerge": "^4.2.2",

},
"gitHead": "7a833c17eac8137eb59f5f6f386cde0a78b63a0f",
"gitHead": "6a105830fd42883439ae18ae7b480ba8d040eb79",
"devDependencies": {

@@ -49,0 +44,0 @@ "@types/pubsub-js": "^1.8.2"

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc