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

add audio-based captcha via espeak #2

Merged
merged 2 commits into from
Aug 5, 2012
Merged

add audio-based captcha via espeak #2

merged 2 commits into from
Aug 5, 2012

Conversation

freewil
Copy link
Contributor

@freewil freewil commented Jul 27, 2012

No description provided.

@yocontra
Copy link
Owner

yocontra commented Aug 5, 2012

Sorry about the delay - github messed up my notifications. Why the change from min ver 0.4 to 0.6? I try to keep everything compatible back to 0.4

yocontra pushed a commit that referenced this pull request Aug 5, 2012
add audio-based captcha via espeak
@yocontra yocontra merged commit e177963 into yocontra:master Aug 5, 2012
@freewil
Copy link
Contributor Author

freewil commented Aug 5, 2012

the only reason i dropped 0.4.x support was because of the espeak dependency. I don't know if there is actually a problem with 0.4.x or not, but i couldnt get travis to run the tests for espeak on 0.4.x

@yocontra
Copy link
Owner

yocontra commented Aug 5, 2012

Yeah it's fine nobody uses 0.4 anyways - thanks for the additions! Pushing to npm now

@yocontra
Copy link
Owner

yocontra commented Oct 3, 2013

FYI I've removed this from 1.0 since it doesn't work on non-linux systems. I think this should be its own module entirely to encapsulate that compatibility.

@freewil
Copy link
Contributor Author

freewil commented Oct 6, 2013

Thanks for the heads up, I'll take a look at the new version when I have some time in the coming weeks.

@freewil
Copy link
Contributor Author

freewil commented Oct 7, 2013

@contra I've been looking at the new version and it looks great - love the new clean pure JS and middleware. I was looking at maybe creating a middleware module for espeak/audio, but it looks like currently the middleware system is only able to support modules that want to somehow manipulate the canvas.

What do you think about making it so that the middleware functions get passed the Captcha object itself instead of just the canvas and options? This way I could simply attach another method to the Captcha object to return audio data from the generated text.

@yocontra
Copy link
Owner

yocontra commented Oct 7, 2013

I actually expose the prototype of the Captcha object on the main module so you can override it or add functions as you see fit.

// in your module
var cgen = require('captchagen');
cgen.Captcha.prototype.audio = function(){
  // do stuff
};

// in userland
somecaptcha.audio(function(err, wav){});

In my opinion I see it as its own module entirely though

espeak.generate(captcha.text(), function(err, wav){});

Totally up to you

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

2 participants