-
Notifications
You must be signed in to change notification settings - Fork 67
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
Conversation
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 |
add audio-based captcha via espeak
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 |
Yeah it's fine nobody uses 0.4 anyways - thanks for the additions! Pushing to npm now |
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. |
Thanks for the heads up, I'll take a look at the new version when I have some time in the coming weeks. |
@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. |
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 |
No description provided.