You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi are you able to write an example of how to implement this app with ionic 2 and typescript. I'm writting a short demo app but i'm not sure how to reference the plugin. I'm getting a '[ts] Cannot find name SpeechRecognition' Error.
Is this plugin compatible with ionic 2 yet?
Below is my main ts component
import{Component}from'@angular/core';import{Platform}from'ionic-angular';import{NavController}from'ionic-angular';//declare var SpeechRecognition: any;declarevarplatform: any;
@Component({selector: 'page-home',templateUrl: 'home.html'})exportclassHomePage{recognition: any;ready: boolean=false;constructor(publicnavCtrl: NavController,platform: Platform){platform=platform;platform.ready().then(()=>{this.ready=true;});}SpeechToText(){if(this.ready){this.recognition=newSpeechRecognition();this.recognition.lang='en-US';this.recognition.onnomatch=(event=>{console.log('No match found.');});this.recognition.onerror=(event=>{console.log('Error happens.');});this.recognition.onresult=(event=>{if(event.results.length>0){console.log('Text: ',event.results[0][0].transcript);}});this.recognition.start();};}}
thanks
The text was updated successfully, but these errors were encountered:
hey @ah3243 i found this ionic guide about how to implement your own ionic-native wrapper. But i do not have enough time to try it myself
once you change your code in cloned ionic-native repo you need to run npm run build and then copy compiled code to your project's node_modules/ionic-native/src
Hi are you able to write an example of how to implement this app with ionic 2 and typescript. I'm writting a short demo app but i'm not sure how to reference the plugin. I'm getting a '[ts] Cannot find name SpeechRecognition' Error.
Is this plugin compatible with ionic 2 yet?
Below is my main ts component
thanks
The text was updated successfully, but these errors were encountered: