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

feat: speak method should use the internal queue of utterances #54

Open
iLoveBug opened this issue Mar 15, 2021 · 4 comments
Open

feat: speak method should use the internal queue of utterances #54

iLoveBug opened this issue Mar 15, 2021 · 4 comments
Labels
breaking change Breaking change feature Feature

Comments

@iLoveBug
Copy link

Is your feature request related to a problem? Please describe.
Some times we could get a text to speak while the previous one is not finished. Currently, each time we call speak() method will cause the queue is flushed and the previous one is stopped immediately.

Describe the solution you'd like
I propose to use the internal queue of utterances, like it is described in the apple document:

The speech synthesizer maintains a queue of utterances that it speaks. If the synthesizer isn’t currently speaking, calling speak(_:) begins speaking that utterance immediately (or begin waiting through its preUtteranceDelay if set). If the synthesizer is speaking, the synthesizer adds utterances to a queue and speaks them in the order received.

Describe alternatives you've considered
Or we can resolve the speak method only after the text is really spoken but not just after the call in invoked immediately.

@robingenz
Copy link
Member

Good point. On Anroid and Web, speak should only resolve after the text is spoken. On iOS this does not currently work (#52).
As far as I know all platforms support the queue.

@robingenz robingenz added feature Feature breaking change Breaking change labels Mar 15, 2021
@robingenz
Copy link
Member

#52 is now fixed (see #59).

@iLoveBug
Copy link
Author

I have a different implementation, please have look at: https://github.com/iLoveBug/text-to-speech.git branch non-stop-tts

@robingenz
Copy link
Member

yes, I've looked at it. The fix is not yet included there.

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

No branches or pull requests

2 participants