From: Nick K. <nk...@sw...> - 2008-02-06 16:30:15
|
Thanks for the reply, Antoine. Looking at the links you provided in the post, the first link declares a DefaultManageableSoundCaptchaService, but never uses it. The second link shows the code for the audio output. I tried to combine the two and create a SoundCaptchaService object by using the following code: SoundCaptchaService scs = new DefaultManageableSoundCaptchaService(); ByteArrayOutputStream soundOutputStream = new ByteArrayOutputStream(); String audio_captchaID = CaptchaModuleConfigHelper.getId(request); AudioInputStream ais = scs.getSoundChallengeForID(audio_captchaID); AudioSystem.write(ais, AudioFileFormat.Type.WAVE, soundOutputStream); soundOutputStream.flush(); soundOutputStream.close(); soundOutputStream.toByteArray(); However, upon code execution, my debugger shows that the SoundCaptchaService object is never created. Can someone explain why? The code I wrote makes sense, but something is wrong with it. Can someone also show me how I would get the sound embedded on a page using struts? I really appreciate your help in my situation. Im anxious to see how I can fully implement this in the site. Thanks, Nick From: jca...@li... [mailto:jca...@li...] On Behalf Of Antoine Véret Sent: Thursday, January 31, 2008 3:20 PM To: jca...@li... Subject: Re: [Jcaptcha-users] Using JCaptcha to embed an audio challenge for the visually impaired Hi Nicholas 1) It is not needed, you should display by default the image captcha and shows the audio captcha when requested 2) one good sample is the Grails JCaptcha plugin located here : http://docs.codehaus.org/display/GRAILS/JCaptcha+Plugin. http://plugins.grails.org/grails-jcaptcha/trunk/grails-app/services/Jcaptcha Service.groovy Cheers On Jan 31, 2008 6:09 PM, Nick Knopf <nk...@sw...> wrote: Hi, I'm a developer for a travel agency, and we use JCaptcha for struts to validate human users, but we recently received a government issue that claimed we needed to account for blind users. I have a few questions for you guys regarding the SoundCaptcha classes in JCaptcha. 1) Can you have both an image captcha and a sound captcha on the same page? I know you can't have them both use the same captcha ID, but can they both exist on a page where you submit either one or the other? 2) Are there any examples on the internet that show you how to embed a SoundCaptcha object on a page? I've been searching the JCaptcha page for a while, searching google, and I can't find anything. Could you guys explain or give me a link on how to do this? I would really appreciate if you helped me out... I have no other choice but to ask you. Thanks! Nicholas Knopf SwiftTrip.com Applications Developer ------------------------------------------------------------------------- This SF.net email is sponsored by: Microsoft Defy all challenges. Microsoft(R) Visual Studio 2008. http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/ _______________________________________________ jcaptcha-users mailing list jca...@li... https://lists.sourceforge.net/lists/listinfo/jcaptcha-users -- Antoine Véret |