Live data from Hacker News

Voice Recognition and Text to Speech in Python

ggulati.wordpress.com

41–50 of 53 posts

Re: Voice Recognition and Text to Speech in Python

#41
post #13

Earlier quoted context omitted.

> It really would be amazing to be able to get voice recognition software that covers at least recognizing a small enough fraction of our language to be useful without having to reach the cloud. Are there any academic groups working on this topic, and do they have prototype implementations?

Julius [1] is a pretty good offline speech recognition engine. In my tests it seems to have about 95% accuracy in grammar-based models, and it supports continuous dictation. There is also a decent Python module which supports Python 2, and Python 3 with a few tweaks. HOWEVER: The only continuous dictation models available for Julius are Japanese, as it is a Japanese project. This is mainly an issue of training data.…

Julius is my preferred speech recognition engine. I've built an application[0] which enables users to control their Linux desktops with their voices, and uses Julius to do the heavy lifting.

[0]: https://github.com/SacredData/COMPUTER

Re: Voice Recognition and Text to Speech in Python

#42
post #11

Kids, it's called "speech recognition". Voice recognition also exists, but it's the task of identifying a user based on his/her voice, not the task of transcribing spoken input as text.

Dad, I told you not to use my hacker news account. Log out please.

Re: Voice Recognition and Text to Speech in Python

#43
For folks who want to try this at home on Mac OS X, you'll need to change 'sapi5' to 'nsss' on the line 'speech_engine = pyttsx.init('sapi5')'.

I also had to 'brew install portaudio flac swig' and a bunch of other python libs. By the time it ran, 'pip freeze' returned:

    altgraph==0.12
    macholib==1.7
    modulegraph==0.12.1
    py2app==0.9
    PyAudio==0.2.9
    pyobjc==3.0.4
    pyttsx==1.1
    SpeechRecognition==3.3.0
    pocketsphinx==0.0.9
My fork of the gist is here: https://gist.github.com/ivanistheone/b988d3de542c1bdd6a90

Re: Voice Recognition and Text to Speech in Python

#44
Nice work, ggulati. I had done some roughly similar stuff, but more basic, using same / similar libraries (but you have researched more libs), a while ago:

Recognizing speech (speech-to-text) with the Python speech module

https://code.activestate.com/recipes/579115-recognizing-spee...

and

Python text-to-speech with pyttsx

https://code.activestate.com/recipes/578839-python-text-to-s...

Good stuff. I like this area.

Re: Voice Recognition and Text to Speech in Python

#45
post #27

Earlier quoted context omitted.

I haven't tried out Pocket Sphinx myself...could you describe the training process, e.g. how long did it take, how much audio did you have to record, how easy was it to iterate to improve accuracy?

PocketSphinx/Sphinx use three models - an acoustic model, a language model and a phonetic dictionary. I'm no expert, but as I understand them, the acoustic model converts audio samples into phonemes(?), the language model contains probabilities of sequences of words, and the phonetic dictionary is a mapping of words to phonemes. Initially, I just used standard en-us acoustic model, US english generic language model,…

If not confidential, can you describe what kinds of automation you used this for, particularly the desktop automation?

I was interested in automating transcription to text of my own reminders to myself and other such audio files, say taken on the PC or on a portable voice recorder, hence the earlier trials I did. But at the time nothing worked out well enough, IIRC.

Re: Voice Recognition and Text to Speech in Python

#46
post #45

Earlier quoted context omitted.

PocketSphinx/Sphinx use three models - an acoustic model, a language model and a phonetic dictionary. I'm no expert, but as I understand them, the acoustic model converts audio samples into phonemes(?), the language model contains probabilities of sequences of words, and the phonetic dictionary is a mapping of words to phonemes. Initially, I just used standard en-us acoustic model, US english generic language model,…

If not confidential, can you describe what kinds of automation you used this for, particularly the desktop automation? I was interested in automating transcription to text of my own reminders to myself and other such audio files, say taken on the PC or on a portable voice recorder, hence the earlier trials I did. But at the time nothing worked out well enough, IIRC.

Nothing confidential at all :). I was playing with them because I personally don't like using keyboard and mouse, and also have some ideas for making computing easier for handicapped people.

My current desktop automation is doing command recognition. Commands like "open editor / email / browser", "shutdown", "suspend"...about 20 commands in all. 'pocketsphinx_continuous' is started as a daemon at startup and keeps listening in the background (I'm on Ubuntu).

I think from a speech recognition internals point of view transcription is more complex than recognizing these short command phrases. The training or adaptation corpus would have to be much larger than what I used.

Re: Voice Recognition and Text to Speech in Python

#49
post #45

Earlier quoted context omitted.

If not confidential, can you describe what kinds of automation you used this for, particularly the desktop automation? I was interested in automating transcription to text of my own reminders to myself and other such audio files, say taken on the PC or on a portable voice recorder, hence the earlier trials I did. But at the time nothing worked out well enough, IIRC.

Nothing confidential at all :). I was playing with them because I personally don't like using keyboard and mouse, and also have some ideas for making computing easier for handicapped people. My current desktop automation is doing command recognition. Commands like "open editor / email / browser", "shutdown", "suspend"...about 20 commands in all. 'pocketsphinx_continuous' is started as a daemon at startup and keeps li…

Thanks. Good uses.

He he, the voice "shutdown" command you mention reminds me of a small assembly language routine that I used to use to reboot MSDOS PCs; it was just a single instruction to jump to the start of the BIOS (cold?) boot entry point, IIRC (JMP F000:FFF0 or something like that). Used to enter it into DOS's DEBUG.COM utility with the A command (for Assemble) and then write it out to disk as a tiny .COM file. (IOW, you did not even need an assembler to create it.)

Then you could reboot the PC just by typing:

REBOOT

at the DOS prompt.

Did all kinds of tricks of the trade (not just like that, many other kinds), in the earlier DOS and (more in) UNIX days ... Good fun, and useful to customers, many a time, too, including saving their bacon (aka data) multiple times (with, of course, no backups by them).

Re: Voice Recognition and Text to Speech in Python

#50
post #11

Kids, it's called "speech recognition". Voice recognition also exists, but it's the task of identifying a user based on his/her voice, not the task of transcribing spoken input as text.

Are there any decent opensource projects out there (preferably with Python APIs) that do speaker or "voice recognition" reasonably well? I know this is an area of active research in academia.
Post reply on HN