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
Wrapping speakClient with function. #17
base: master
Are you sure you want to change the base?
Conversation
Ah, this is very nice! I am concerned though with adding functions to the window object, which I think the code here does? Do other projects do such things? For example, I worry that if the browser window object gets a |
You are right. I made it this way to be consistent with your speak() API. Ultimately, we should provide these API under some namespace. e.g. TTS so TTS.speak(), TTS.pause(), etc. Do you think TTS is good name or do you have something else in your mind? Thanks! |
I was using Speak.js on a project this weekend and can't wait to see the onended, pause(), and resume() features getting added. This is an awesome tool with a lot of potential and the features in this pull request will help out a ton! Looking forward to updates! |
Sorry for the lack of updates on my part, I am super-busy with other projects and can't seem to find time for this. But I hope someone makes a fork and does cool stuff there. I am happy to call such a fork the "official version" if there is one, in the project page. |
In that case, I can participate on that since I have that branch already. I will finish up with wrapping the API asap on my fork. Thanks and good luck with your other projects! |
Now I merged the latest branch with my change in https://github.com/kn/speak.js Basically, I made 'speak' as a global variable rather than function with APIs:
You can read the detail in its README if you are interested. Thanks! Katsuya |
Looks like nice work :) Do you want me to link to your fork in the main page? |
That will be great :) Thanks! |
Done. |
It's https://github.com/kn/speak.js now. |
Hi kripken,
Nice work with speak.js!
I wrapped speakClient file with a function for better global scope control, which allows it to be used in any environment (like the way js library like jQuery does).
Probably, we should define name space like SpeakJS in the future (I will do that if you agree with the name) to avoid name conflict.
In addition, I added support for onended callback for the speak() function. The speak() function still works as it is but also it accepts optional callback parameter, which is called when speech finishes.
Further more, I add pause() and resume() functions for convenience.
Thanks!
Katsuya