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

Speech Queuing? Return references to speech objects? #34

Open
tlhunter opened this issue Feb 15, 2016 · 4 comments
Open

Speech Queuing? Return references to speech objects? #34

tlhunter opened this issue Feb 15, 2016 · 4 comments

Comments

@tlhunter
Copy link
Collaborator

As it is, many bits of text can be fired off at the same time, and they all talk in parallel. See the existing examples/osx-*.js files.

Queue:
Queue up audio to be spoken and play them all sequentially. As items are played and finished their callbacks will fire. We'd need a way to flush the queue as well. Having callbacks on a per-text basis might not be as useful as, perhaps, an EventEmitter approach.

Playback Handles:
We keep allowing the user to manage all of this. We'd need a way to return a reference to the audio being spoken so that the user can cancel it, much like var x = setTimeout(); clearTimeout(x); works.

Either way, we will need to massively rewrite how say works, including all consumer facing API's.

@derhuerst
Copy link

Maybe something like the queue package can be reused.

@tlhunter
Copy link
Collaborator Author

tlhunter commented Nov 5, 2017

Now that Node v8 is LTS and we've got async/await everywhere we should promisify the methods. We can then perform our "speech queueing" like this:

for (let i = 0; i < sentences.length; i++) {
  await say.speak(sentence[i]);
}

@Arlodotexe
Copy link

It's brand new so it's pretty spaghetti right now, but I made this https://github.com/Arlodotexe/async-sayjs

@SimpleCookie
Copy link

It's brand new so it's pretty spaghetti right now, but I made this https://github.com/Arlodotexe/async-sayjs

Seems good although it doesn't work.
It's "almost" synchronous (btw you mixed up sync and async in your readme I guess).
synchronous should wait for the previous "speak" to finish while asynchronous should just speak em in parallel.

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

4 participants