Does any one know of an application that can convert audio to text? I'm running ubuntu 12.04 LTS.

  • I assume it is spoken text. Which language is that text in? – Martin Ueding Jul 9 '12 at 11:33
  • The speech text is in simple english. – Kopano Jul 9 '12 at 14:33

The software you can use is CMUSphinx. Unlike suggested in another answer Julius is not suitable because it requires models. Models for large vocabulary speech recognition are not available for Julius.

You can use pocketsphinx to convert audio file. Those two commands must do the work. First you convert the file to the required format and then you recognize it:

ffmpeg -i file.mp3 -ar 16000 -ac 1 file.wav

The run pocketsphinx

pocketsphinx_continuous -infile file.wav 2> pocketsphinx.log > result.txt

Result will be stored in result.txt.

  • also, as an addition to this answer, there's a cool demo of both speech recognition and voice command tools here: youtube.com/… – Daithí Jan 8 '15 at 10:22
  • How do you add an acoustic model to the system? – jarno Feb 8 '15 at 13:38
  • You just download it and unpack, there is no such thing as "add to the system" – Nikolay Shmyrev Feb 8 '15 at 13:56
  • @NikolayShmyrev Where should I unpack it so that pocketsphinx_continuous finds it? – jarno Feb 8 '15 at 14:14
  • 4
    Well, I installed packages pocketsphinx-utils, pocketsphinx-hmm-en-hub4wsj and pocketsphinx-lm-en-hub4 in universe repository of Ubuntu 14.04. Then pocketsphinx_continuous -infile file.wav -hmm en_US/hub4wsj_sc_8k -lm en_US/hub4.5000.DMP 2> pocketsphinx.log worked. Maybe they are not optimal packages, but they were best matches I could find in the repositories. – jarno Feb 8 '15 at 15:05

I know this is old, but to expand on Nikolay's answer and hopefully save someone some time in the future, in order to get an up-to-date version of pocketsphinx working you need to compile it from the github or sourceforge repository (not sure which is kept more up to date). Note the -j8 means run 8 separate jobs in parallel if possible; if you have more CPU cores you can increase the number.

git clone https://github.com/cmusphinx/sphinxbase.git
cd sphinxbase
make -j8
make -j8 check
sudo make install
cd ..
git clone https://github.com/cmusphinx/pocketsphinx.git
cd pocketsphinx
make -j8
make -j8 check
sudo make install
cd ..

Then, from: https://sourceforge.net/projects/cmusphinx/files/Acoustic%20and%20Language%20Models/US%20English/ download the newest versions of cmusphinx-en-us-....tar.gz and en-70k-....lm.gz

tar -xzf cmusphinx-en-us-....tar.gz
gunzip en-70k-....lm.gz

Then you can finally proceed with the steps from Nikolay's answer:

ffmpeg -i book.mp3 -ar 16000 -ac 1 book.wav
pocketsphinx_continuous -infile book.wav \
    -hmm cmusphinx-en-us-8khz-5.2 -lm en-70k-0.2.lm \
    2>pocketsphinx.log >book.txt

Sphinx works alright. I wouldn't rely on it to make a readable version of the text, but it's good enough that you can search it if you're looking for a particular quote. That works especially well if you use a search algorithm like Xapian (http://www.lesbonscomptes.com/recoll/) which accepts wildcards and doesn't require exact search expressions.

Hope this helps.

  • 4
    every thing works like a charm but in my case i had to run following command to fix pocketsphinx_continuous: error while loading shared libraries: libpocketsphinx.so.3: cannot open shared object file: No such file or directory -------> export LD_LIBRARY_PATH=/usr/local/lib -------> export PKG_CONFIG_PATH=/usr/local/lib/pkgconfig – Vijay Dohare Sep 19 '17 at 11:30
  • This is also recommended at cmusphinx.github.io/wiki/tutorialpocketsphinx/… – andrybak Sep 19 at 21:58

I you are looking to convert speech to text you could try opening up your Ubuntu Software Center and search for Julius


"Julius" is a high-performance, two-pass large vocabulary continuous speech recognition (LVCSR) decoder software for speech-related researchers and developers.

Or another option that isn't in the Software Center is Simon

... is an open-source speech recognition program and replaces the mouse and keyboard.

Reference Links





You can use speechpad.pw transcription panel

See video of using transcription

  • That looks cool although I don't think it answers the question which was to get a transcription of an existing file. That being said, I just tried Sphinx and it failed miserably... the transcription was 99.9% wrong. – Alexis Wilke Nov 10 '17 at 18:47

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.