# Using Audio Code

In order for **RadCaptcha** to be accessible by visually impaired users, the control can generate an audio code. Every alphanumeric character is read out using the [NATO phonetic alphabet](https://en.wikipedia.org/wiki/NATO_phonetic_alphabet).

To enable this functionality you need to simply set the **CaptchaImage-EnableCaptchaAudio** property to **true**.

This will cause a link button, that retrieves the audio code, to be rendered below the **CaptchaImage**. To control the visual appearance of the link button, the user should use the .**rcCaptchaAudioLink** CSS class.

Since the Q3 2013 release of Telerik® UI for ASP.NET AJAX, RadCaptcha has an option for enabling a random background noise for the generated audio code. This functionality can be used by setting the property **CaptchaImage-EnableAudioNoise** to **true**.

## How the audio code is generated?

By default, the **System.Speech.Synthesis** namespace is used to "Speak" the randomly generated text code by default.

If you set the **CaptchaImage-UseAudioFiles** property to **true**, the audio code will be generated by concatenating `.wav` files from the application directory.
This can be useful if you cannot provide elevated privileges for speech synthesis (see below), or it has [poor performance](https://www.telerik.com/support/kb/aspnet-ajax/captcha/details/high-cpu-usage-with-radcaptcha-audio-code), or you want to provide your own sounds.

> note In order for the Captcha to be able to output an audio file the web application must be run in a **[ASP.NET Full Trust level](https://msdn.microsoft.com/en-us/library/tkscy493%28v=vs.85%29.aspx)** environment.

The application must run as a user account that has permissions to call the [SpeechSynthesizer.Speak(textToSpeak) method](https://msdn.microsoft.com/en-us/library/ms586901.aspx) on the server. Usually the user account does not have the needed permissions and the administrator has to grant them. For example in [IIS 6+ the Application Pools](https://www.microsoft.com/technet/prodtechnol/WindowsServer2003/Library/IIS/f05a7c2b-36b0-4b6e-ac7c-662700081f25.mspx?mfr=true) run as the ApplicationPoolIdentity built-in account (this is by default) which does not have enough permissions to call SpeechSynthesizer.Speak(textToSpeak). To generate the code the Application Pools should have permissions as the LocalSystem built-in account.

In case the web application does not have enough permissions to "Speak" the text code, the audio file will be generated by concatenation of ".wav" files that correspond to the specific character from the text code. By default RadCaptcha will look for the files in the **\~/App_Data/RadCaptcha** directory, so you need to supply the folder and the files. You can copy the **App_Data\RadCaptcha** directory located in the **App_Data** folder of your **Telerik® UI for ASP.NET AJAX** installation. A different location for the audio files can be used by setting the directory path to RadCaptcha's **CaptchaImage-AudioFilesPath** property.

> note In order for the audio code to be generated correctly when concatenating files, there must be a `.wav` file for every possible character that can appear on the image, and the file must be named as the character itself - `<Char>.wav` (for example,. `A.wav`, `B.wav`, `C.wav`, `1.wav`, `2.wav` and so on).

## Tutorial - How to configure RadCaptcha to generate audio code?

The following tutorial demonstrates how to configure RadCaptcha to generate audio code.

1. Follow the steps from the "[Getting Started](https://www.telerik.com/products/aspnet-ajax/documentation/controls/captcha/getting-started)" tutorial to create a web-site with RadCaptcha control.

2. In the Solution Explorer, right-click the project and select *Add* > *Add ASP.NET Folder* > *App_Data*.

3. Locate the **App_Data** folder in your Telerik® UI for ASP.NET AJAX installation.

4. Copy the **App_Data\RadCaptcha** to the project's **\~/App_Data** folder.

5. The project structure should now look like the screenshot below.

   ![Rad Captcha App Data](https://www.telerik.com/products/aspnet-ajax/documentation/assets/1e6d81eb0770fb40fa7a6014f48726dc/radcaptcha_app_data.png)

6. Enable the CaptchaAudio feature by setting the **CaptchaImage-EnableCaptchaAudio** property to **true**.

7. Press F5 to run the Application. RadCaptcha validates the input on a post back.

   ![radcaptcha-audio-enabled](https://www.telerik.com/products/aspnet-ajax/documentation/assets/f771b72441dfaf05e98c5b9bf9582af1/radcaptcha-audio-enabled.png)
