Quantcast
Channel: Ionic Forum - Latest posts
Viewing all articles
Browse latest Browse all 230059

Displaying speech recognition content body in Ion textarea

$
0
0

Hello,
I am currently trying to develop an application that captures text that is spoken when the Cordova speech plugin is activated and then “dynamically” show it in the text area when the listener stops.

Currently i am only able to display the text after i focus the text area after recording and then click out of it…

Here is an excerpt of my code that toggles the speech recognition listener:
toggleRecording() {
const options = {
language: ‘en-US’,
matches: 1
};
this.speechRecogntion.startListening(options).subscribe(matches => {
for (let i = 0; i < this.speechContents.length; i++) {
this.speechContents[i] += matches[i] + '. ';
}
});
}

I save the generated match into a string array and then in my ion-text area element I attempt to set the value like this:
<ion-textarea type=“text” rows=8 name=“description” id=“description” *ngFor=“let content of speechContents” value="{{content}}">

Has someone here done this before?
Tips are greatly appreciated!


Viewing all articles
Browse latest Browse all 230059

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>