Creating Audio Files
This page describes how-to and best practices for creating your own audio files for Securimage.
If you want to translate Securimage into another language, or just use different sounds than those provided with Securimage, these directions will explain how to properly create and encode the audio.
Securimage uses the WAV file format for its audio files and sources. The main reason for this is because in order for audio CAPTCHAs to be secure, an attacker should not be able to determine the original file sources used to make up the CAPTCHA audio. If a compressed audio format were used (such as MP3), this would not be possible without special encoding software beyond the scope of PHP.
Therefore, all audio files you create for Securimage should be in WAV format.
Since WAV files are uncompressed, it is desirable to keep the audio files as small as possible. To help achieve this, the following encoding parameters are used with the supplied audio files and are recommended for maximum portability:
- 16-bit PCM format (supports 8 and 24 bit, but not recommended for quality and size reasons)
- Mono (1 channel)
- Sample Rate: 11,025 Hz or less
Required Sound Files
To fully support all possible characters in the CAPTCHA, there should be one audio file for each character that appears in the CAPTCHA.
It is recommended that you create audio files for the following English characters: A-Z, 0-9.
To support mathematical captchas, you should have the following files: PLUS.wav (addition), MINUS.wav (subtraction), TIMES.wav (multiplication).
A file called error.wav will be served if creating the audio file fails. This should provide a verbal error message explaining that an error occurred.
All files containing non-numeric characters should be saved using UPPERCASE characters.
Each audio file must have the extension .wav in lower case.
Background Noise Files
In addition to the sound files for creating verbal CAPTCHA codes, sound files containing background noise can be included and used as well. There are no limitations on the names of the files except that the must end in the .wav extension.
It is recommended that the noise files be at least 6 seconds, or long enough to span the duration of the full CAPTCHA audio playback.
The background noise files must also be encoded with the same parameters as the other audio files.