In a previous article I published a solution to convert Asterisk voicemail attachments from WAV to MP3 on the fly. This is done by catching the mails sent by Asterisk just before they are passed to sendmail.
I recently got the idea from Daniel Dainty to add Voice Recognition feature at the same time as mp3 encoding.
After testing different voice recognition engines, I realized that the Google Speech Recognition API is by far superior to any other solution available under Linux (Sphinx, ...).
This article will explain an approach to add voice recognition to Asterisk voicemail using the services of Google Speech Recognition API.
The principle is very simple. After doing the voicemail mp3 conversion, the script :
- does some pre-processing clean-up on the file,
- converts it to an acceptable format (flac),
- sends it to Google speech recognition engine,
- gets back the text version
- adds it at the end of the mail body.
This procedure has been done on a Debian Squeeze server. It should be fully compatible with an Ubuntu server. You will then just need to add sudo to the commands needing root privilege.