Closed slycoder closed 7 years ago
@slycoder Thanks a lot for PR.
Did you test this changes, generating UUID for each utterance wouldn't be expensive ?
@mihirsoni I didn't notice any speed degradation when I tried. I suspect that the amount of time needed to construct the speech is much larger than the amount of time required to generate a UUID. But to be fair, I didn't rigorously test this assumption with any benchmarks. If it's a concern I can change this to just use nanotime instead. How does that sound?
@slycoder Cool , I will test this and merge this, once again thanks for the PR \m/
This change adds a UtteranceProgressListener onto the tts object. These just pass the event along via the device event emitter so that javascript listeners can detect these events.
In order for this to work, you need to set the utterance id (otherwise it the progress listener will not be called. I’m creating them by just generating UUIDs for each utterance.