Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unable to get the supported voices #12

Open
asifnkhan opened this issue Nov 11, 2021 · 9 comments
Open

Unable to get the supported voices #12

asifnkhan opened this issue Nov 11, 2021 · 9 comments

Comments

@asifnkhan
Copy link

asifnkhan commented Nov 11, 2021

I am trying to fetch all the supported voices using the code provided below:

this.platform.ready().then((source) => {
      this.tts.getVoices().then(voices => {
        console.log(voices);
      }, error => {
        console.log(error);
      });
});

I am just not getting anything. Any help is greatly appreciated.

@lnzhaotian
Copy link

Same here. Wonder if anyone has a solution.

@Another-Developer
Copy link

I don't know if I was experiencing the exact same issue as either of you, or if you're still looking/waiting for a solution. But for anyone else that is experiencing this issue, these are my findings.

I am using this plugin (v0.5.2) in conjunction with the @awesome-cordova-plugins/text-to-speech-advanced (v5.41.0) plugin in an Ionic Angular project. I also tried using the @ionic-native binding for this plugin.

I was trying to get all the supported voices, but kept receiving nothing in my TypeScript code, but saw that the TTS java code was returning results. Later on I came to the conclusion that all of the functions were exhibiting the same issue. None of them were resolving or rejecting.

For me the solution was to skip the TS bindings and import this plugin directly.

@fpavlic
Copy link

fpavlic commented Dec 2, 2022

Hi everyone, I'm experiencing same issue. Any simple fix?
@Another-Developer could you help by writing steps to your solution?

@Merlin99M
Copy link

@Another-Developer could you explain us how to "skip the TS bindings and import this plugin directly" ?

@brittonk
Copy link

I was having the same issue-- no voices returned.

To resolve it:

  1. Remove the Android/iOS Platforms from your Cordova Project

  2. Update your src files from this fork:
    https://github.com/nenahov/cordova-plugin-tts-advanced

  3. Add the platforms back to your cordova project.

  4. You can now get the voice identifier array.

`function onDeviceReady() {

  TTS.getVoices().then(voices => {
    console.log(voices);
  }, error => {
    console.log(error);
  });

}`

@spasma
Copy link
Owner

spasma commented Oct 24, 2023

Thank you for this fix, I've merged your change to this repo. Next time, please create a PR with this kind of changes :-)

@brittonk
Copy link

Thank you for this fix, I've merged your change to this repo. Next time, please create a PR with this kind of changes :-)

I'd be glad to but since it was from a fork's work and not mine I don't know what else they may have changed so I didn't want to create a PR of someone else's sweat and toil, just point others at it :D

Thanks for the plugin and keeping it up!

@spasma
Copy link
Owner

spasma commented Oct 24, 2023

Ah my bad, thank you! I've just published this small fix to npm as cordova-plugin-tts-advanced:0.5.3

@DesignerApparelSales
Copy link

TTS.getVoices() dont work in andriod. Work fine in iso tho

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

8 participants