All Projects β†’ EddyVerbruggen β†’ Nativescript Speech Recognition

EddyVerbruggen / Nativescript Speech Recognition

Licence: other
πŸ’¬ Speech to text, using the awesome engines readily available on the device.

Programming Languages

typescript
32286 projects

Projects that are alternatives of or similar to Nativescript Speech Recognition

leopard
On-device speech-to-text engine powered by deep learning
Stars: ✭ 354 (+391.67%)
Mutual labels:  voice-recognition, speech-recognition, speech-to-text
AmazonSpeechTranslator
End-to-end Solution for Speech Recognition, Text Translation, and Text-to-Speech for iOS using Amazon Translate and Amazon Polly as AWS Machine Learning managed services.
Stars: ✭ 50 (-30.56%)
Mutual labels:  voice-recognition, speech-recognition, speech-to-text
react-native-spokestack
Spokestack: give your React Native app a voice interface!
Stars: ✭ 53 (-26.39%)
Mutual labels:  voice-recognition, speech-recognition, speech-to-text
Sonus
πŸ’¬ /so.nus/ STT (speech to text) for Node with offline hotword detection
Stars: ✭ 532 (+638.89%)
Mutual labels:  speech-recognition, speech-to-text, voice-recognition
Cheetah
On-device streaming speech-to-text engine powered by deep learning
Stars: ✭ 383 (+431.94%)
Mutual labels:  speech-recognition, speech-to-text, voice-recognition
Voice Overlay Android
πŸ—£ An overlay that gets your user’s voice permission and input as text in a customizable UI
Stars: ✭ 189 (+162.5%)
Mutual labels:  speech-recognition, speech-to-text, voice-recognition
KeenASR-Android-PoC
A proof-of-concept app using KeenASR SDK on Android. WE ARE HIRING: https://keenresearch.com/careers.html
Stars: ✭ 21 (-70.83%)
Mutual labels:  voice-recognition, speech-recognition, speech-to-text
octopus
On-device speech-to-index engine powered by deep learning.
Stars: ✭ 30 (-58.33%)
Mutual labels:  voice-recognition, speech-recognition, speech-to-text
voce-browser
Voice Controlled Chromium Web Browser
Stars: ✭ 34 (-52.78%)
Mutual labels:  voice-recognition, speech-recognition, speech-to-text
spokestack-ios
Spokestack: give your iOS app a voice interface!
Stars: ✭ 27 (-62.5%)
Mutual labels:  voice-recognition, speech-recognition, speech-to-text
Vosk
VOSK Speech Recognition Toolkit
Stars: ✭ 182 (+152.78%)
Mutual labels:  speech-recognition, speech-to-text, voice-recognition
Voice Overlay Ios
πŸ—£ An overlay that gets your user’s voice permission and input as text in a customizable UI
Stars: ✭ 440 (+511.11%)
Mutual labels:  speech-recognition, speech-to-text, voice-recognition
Spokestack Python
Spokestack is a library that allows a user to easily incorporate a voice interface into any Python application.
Stars: ✭ 103 (+43.06%)
Mutual labels:  speech-recognition, speech-to-text, voice-recognition
Speechrecognizerbutton
UIButton subclass with push to talk recording, speech recognition and Siri-style waveform view.
Stars: ✭ 144 (+100%)
Mutual labels:  siri, speech-recognition, speech-to-text
Vosk Api
Offline speech recognition API for Android, iOS, Raspberry Pi and servers with Python, Java, C# and Node
Stars: ✭ 1,357 (+1784.72%)
Mutual labels:  speech-recognition, speech-to-text, voice-recognition
open-speech-corpora
πŸ’Ž A list of accessible speech corpora for ASR, TTS, and other Speech Technologies
Stars: ✭ 841 (+1068.06%)
Mutual labels:  voice-recognition, speech-recognition, speech-to-text
Rhino
On-device speech-to-intent engine powered by deep learning
Stars: ✭ 406 (+463.89%)
Mutual labels:  speech-recognition, speech-to-text, voice-recognition
Speech To Text Benchmark
speech to text benchmark framework
Stars: ✭ 481 (+568.06%)
Mutual labels:  speech-recognition, speech-to-text, voice-recognition
Audio Pretrained Model
A collection of Audio and Speech pre-trained models.
Stars: ✭ 61 (-15.28%)
Mutual labels:  speech-recognition, speech-to-text
Syn Speech
Syn.Speech is a flexible speaker independent continuous speech recognition engine for Mono and .NET framework
Stars: ✭ 57 (-20.83%)
Mutual labels:  speech-recognition, speech-to-text

NativeScript Speech Recognition

Build Status NPM version Downloads Twitter Follow

This is the plugin demo in action..

..while recognizing Dutch πŸ‡³πŸ‡± .. after recognizing American-English πŸ‡ΊπŸ‡Έ

Installation

From the command prompt go to your app's root folder and execute:

tns plugin add nativescript-speech-recognition

Testing

You'll need to test this on a real device as a Simulator/Emulator doesn't have speech recognition capabilities.

API

available

Depending on the OS version a speech engine may not be available.

JavaScript

// require the plugin
var SpeechRecognition = require("nativescript-speech-recognition").SpeechRecognition;

// instantiate the plugin
var speechRecognition = new SpeechRecognition();

speechRecognition.available().then(
  function(available) {
    console.log(available ? "YES!" : "NO");
  }
);

TypeScript

// import the plugin
import { SpeechRecognition } from "nativescript-speech-recognition";

class SomeClass {
  private speechRecognition = new SpeechRecognition();
  
  public checkAvailability(): void {
    this.speechRecognition.available().then(
      (available: boolean) => console.log(available ? "YES!" : "NO"),
      (err: string) => console.log(err)
    );
  }
}

requestPermission

You can either let startListening handle permissions when needed, but if you want to have more control over when the permission popups are shown, you can use this function:

this.speechRecognition.requestPermission().then((granted: boolean) => {
  console.log("Granted? " + granted);
});

startListening

On iOS this will trigger two prompts:

The first prompt requests to allow Apple to analyze the voice input. The user will see a consent screen which you can extend with your own message by adding a fragment like this to app/App_Resources/iOS/Info.plist:

<key>NSSpeechRecognitionUsageDescription</key>
<string>My custom recognition usage description. Overriding the default empty one in the plugin.</string>

The second prompt requests access to the microphone:

<key>NSMicrophoneUsageDescription</key>
<string>My custom microphone usage description. Overriding the default empty one in the plugin.</string>

TypeScript

// import the options
import { SpeechRecognitionTranscription } from "nativescript-speech-recognition";

this.speechRecognition.startListening(
  {
    // optional, uses the device locale by default
    locale: "en-US",
    // set to true to get results back continuously
    returnPartialResults: true,
    // this callback will be invoked repeatedly during recognition
    onResult: (transcription: SpeechRecognitionTranscription) => {
      console.log(`User said: ${transcription.text}`);
      console.log(`User finished?: ${transcription.finished}`);
    },
    onError: (error: string | number) => {
      // because of the way iOS and Android differ, this is either:
      // - iOS: A 'string', describing the issue. 
      // - Android: A 'number', referencing an 'ERROR_*' constant from https://developer.android.com/reference/android/speech/SpeechRecognizer.
      //            If that code is either 6 or 7 you may want to restart listening.
    }
  }
).then(
  (started: boolean) => { console.log(`started listening`) },
  (errorMessage: string) => { console.log(`Error: ${errorMessage}`); }
).catch((error: string | number) => {
  // same as the 'onError' handler, but this may not return if the error occurs after listening has successfully started (because that resolves the promise,
  // hence the' onError' handler was created.
});
Angular tip

If you're using this plugin in Angular, then note that the onResult callback is not part of Angular's lifecycle. So either update the UI in an ngZone as shown here, or use ChangeDetectorRef as shown here.

stopListening

TypeScript

this.speechRecognition.stopListening().then(
  () => { console.log(`stopped listening`) },
  (errorMessage: string) => { console.log(`Stop error: ${errorMessage}`); }
);

Demo app (Angular)

This plugin is part of the plugin showcase app I built using Angular.

Angular video tutorial

Rather watch a video? Check out this tutorial on YouTube.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].