Last active
March 7, 2017 08:54
-
-
Save EddyVerbruggen/13b7406db9b61afdf7b92bc8f1c720fc to your computer and use it in GitHub Desktop.
Speech Recognition in NativeScript (availability check)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// import the plugin | |
import { SpeechRecognition } from "nativescript-speech-recognition"; | |
class SpeechRecognition { | |
// instantiate the plugin | |
private speechRecognition = new SpeechRecognition(); | |
public checkAvailability(): void { | |
this.speechRecognition.available().then( | |
(available: boolean) => console.log(available ? "YES!" : "NO"), | |
(err: string) => console.log(err) | |
); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment