$99 VS $1000+. UI Control for ASP.NET AJAX(contains chart and gridview).
Captcha Feature Using Audio Code in ASP.NET
Home > How to > Captcha Using Audio Code

Audio code is one of the prominent features of KT.UI Captcha Control. To enable this useful and interesting functionality, users just need to set the CaptchaImage-EnableCaptchaAudio property as true. Once this property is fired, it will cause a link button that retrieves the audio code, displayed below the CaptchaImage.
With the mature captcha component of KT.UI for ASP.NET AJAX, users have full options to enable any random background noise for the generated audio code in order to improve the control's security and this functionality can be used by setting the property CaptchaImage-EnableAudioNoise to true.

How to Generate the Audio Code

KT.UI offers reliable system speech namespace to be used to create and generate random audio code. In order for the Captcha to be able to output an audio file the web application must be run in a full trust environment. Technically the application should run as a user account that has permissions to call the code speech system on the server.
Before the web application can generate audio code, the audio file needs to be generated by concatenation of ".wav" files that correspond to the specific character from the text code. Users can use a different location for the audio files that can be used by setting the directory path to PerCaptcha's CaptchaImage - AudioFilesPath property. And in order to make the control always generate the audio code by concatenating the ".wav" files, please set the CaptchaImage-UseAudioFiles property to false.

How to Configure PerCaptcha to Generate Audio Code

Users can refer to following detailed guides to generate and configure audio code by using PerCaptcha control within Visual Studio ASP.NET application, and please note that, our PerCaptcha Control can be well integrated within Visual Studio 2010, 2012 or any greater version.
  1. At the very beginning, users need to create a web site with ASP.NET application with PerCaptcha control. For this step, users can follow the detailed steps from the PerCaptcha Getting Started tutorial.
  2. After users have built the require PerCaptcha web application within Visual Studio 2010, you can right-click the project and select Add | Add ASP.NET Folder | App_Data in the Solution Explorer;
  3. Locate the App_Data folders in your KT UI for ASP.NET AJAX installation;
  4. Then, you need to copy the App_Data\RadCaptcha to the project's \App_Data folder;
  5. If you finish above operations, the project structure should look like the screenshot displayed below.

    /how-to/aspnet-ajax/controls-captcha/controls-captcha-feature-audio-code.jpg
  6. Enable the CaptchaAudio feature by setting the CaptchaImage.EnableCaptchaAudio property as true.
  7. Following demo ASPX codes are for setting the CaptchaImage.EnableCaptchaAudio property as true.

<kettic:PerCaptcha ID="PerCaptcha1"
runat="server"
ValidationGroup="vgAudio"
CaptchaAudioLinkButtonText="Play Audio">
<CaptchaImage EnableCaptchaAudio="true"
RenderImageOnly="true"
ImageCssClass="rcCaptchaImage"
BackgroundNoise="None" >
</CaptchaImage>
</kettic:PerCaptcha>
Now, PerCaptcha validates the input like the screenshot below after you press F5 to run the application.

/how-to/aspnet-ajax/controls-captcha/controls-captcha-feature-audio-code 2.jpg
ASP.NET AJAX UI Controls