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

Wrapping speakClient with function. #17

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open

Wrapping speakClient with function. #17

wants to merge 3 commits into from

Conversation

kn
Copy link

@kn kn commented Jan 24, 2012

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

@kripken
Copy link
Owner

kripken commented Feb 19, 2012

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 play method in the future, it will collide here with yours. Or maybe I misunderstood the code?

@kn
Copy link
Author

kn commented Feb 22, 2012

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!

@JamesEggers1
Copy link

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!

@kripken
Copy link
Owner

kripken commented Jun 4, 2012

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.

@kn
Copy link
Author

kn commented Jun 4, 2012

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!

@kn
Copy link
Author

kn commented Jun 5, 2012

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:

  • speak.play
  • speak.pause
  • speak.resume

You can read the detail in its README if you are interested.

Thanks!

Katsuya

@kripken
Copy link
Owner

kripken commented Jun 11, 2012

Looks like nice work :) Do you want me to link to your fork in the main page?

@kn
Copy link
Author

kn commented Jun 11, 2012

That will be great :)

Thanks!

@kripken
Copy link
Owner

kripken commented Jun 12, 2012

Done.

@Doctorrr
Copy link

Doctorrr commented Sep 1, 2013

@kn
Copy link
Author

kn commented Sep 6, 2013

It's https://github.com/kn/speak.js now.

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

Successfully merging this pull request may close these issues.

None yet

4 participants