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

speech-to-text

Package Overview
Dependencies
Maintainers
1
Versions
13
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

speech-to-text - npm Package Compare versions

Comparing version 0.3.7 to 0.3.8

13

lib/index.js

@@ -19,6 +19,7 @@ 'use strict';

(slow, much more accuate)
onFinishedListening - a callback that will be called when the speech recognition stops listening
language - the language to interpret against. Default is US English.
*/
function SpeechToText(onAnythingSaid, onFinalised) {
var language = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 'en-US';
function SpeechToText(onAnythingSaid, onFinalised, onFinishedListening) {
var language = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : 'en-US';

@@ -40,6 +41,8 @@ _classCallCheck(this, SpeechToText);

var finalTranscript = '';
// process both interim and finalised results
this.recognition.onresult = function (event) {
var interimTranscript = '';
var finalTranscript = '';
// concatenate all the transcribed pieces together (SpeechRecognitionResult)

@@ -59,2 +62,6 @@ for (var i = event.resultIndex; i < event.results.length; i += 1) {

};
this.recognition.onend = function () {
return onFinishedListening();
};
}

@@ -61,0 +68,0 @@

{
"name": "speech-to-text",
"version": "0.3.7",
"version": "0.3.8",
"description": "A speech to text module.",

@@ -5,0 +5,0 @@ "main": "./lib/index.js",

@@ -35,2 +35,3 @@ # Speech To Text

- onFinalised: this is a callback function that is called with the full text as it has been resolved in the cloud.
- onFinishedListening: this is a callback function that is called when the speech recognitions stops listening.
- language: This is an optional string that specifies the language to be interpreted as. Default is United States English. 'en-US'

@@ -48,3 +49,3 @@

Initiates listening to speech input and will continue to call the callback functions provided until the speech is finalised. After which you'll need to call this function again.
Initiates listening to speech input and will continue to call the callback functions provided until the speech recognition stops listening. After which you'll need to call this function again.

@@ -51,0 +52,0 @@ ## License

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