Hello, I’m new to Ionic projects and doing some few tests I ended up finding this problem. I don’t really know if is some configuration problem or a framework problem.
I have a simple page with a button that calls the textToSpeech() method.
Code:
import { Component } from ‘@angular/core’;
import {TextToSpeech} from ‘ionic-native’;
import { LoadingController } from ‘ionic-angular’;
@Component({
selector: ‘page-home’,
templateUrl: ‘home.html’
})
export class HomePage {
constructor(public loadingCtrl: LoadingController) {
}
textToSpeech() {
let loader = this.loadingCtrl.create({
content: “Please wait…”,
duration: 3000
});
loader.present();
TextToSpeech.speak({
text: "Teste em português",
locale: 'pt-BR',
rate: 0.75
});
}
}
Using the android emulator it works almost fine, despite the detail that the locale is totaly ignored and the speech is the english one reading a portuguese sentence. On my device (Moto-play with the ionic view app) it doesn’t work at all, I click in the button and there is no sound.
Can I have some help with it?