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

waiting for stop event. #6

Open
Simbaclaws opened this issue Mar 30, 2021 · 3 comments
Open

waiting for stop event. #6

Simbaclaws opened this issue Mar 30, 2021 · 3 comments

Comments

@Simbaclaws
Copy link

Hey,

apparently when I do:

TTS.stop().then(() => {
          this.isTalking = false;
          console.log('stopped');
        }).catch((reason: any) => {
          this.isTalking = false;
          console.log(reason);
        });

The then and catch are not being called...
The stop is being called though, so I think I'lll just remove the .then and set it to false after calling stop.

It is nice to have a callback to know whether it stopped or errored out for some reason though.

@blukis
Copy link

blukis commented Apr 14, 2021

Just as a workaround to this, I've been using...

TTS.speak({text: "", cancel: true }).then(
    function() { alert("success"); },
    function(msg) { alert("error: " + JSON.stringify(msg)); }
);

@givethanks1
Copy link

givethanks1 commented May 27, 2021

Great plugin, works very nicely on Android.

However, I'm also seeing a similar cancel issue as the first user on iOS. When i run the following, the speaking stops. Which is great.
However, it does not actually show the "successful cancel" in the log / output the console.log value until i try to perform the next TTS.speak action.
At which point it executes the earlier cancel and shows 'successful cancel' in the console.log area (but: it's after the user has asked for the next piece of speech -- which leads to its cancellation). The user must press "play" twice to get it to play again after a stop/cancel.

TTS.speak({text: "", cancel: true }).then(
    function() { console.log('successful cancel'); },
    function(msg) { console.log('failure to cancel'); }
);

Any suggestions are welcome.

@givethanks1
Copy link

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

3 participants