Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import pygtk,gtk,gobject
- gobject.threads_init()
- import gst
- def result(asr, text, uttid): print text
- pipeline=gst.parse_launch('pulsesrc ! audioconvert ! audioresample ! vader name=vad auto-threshold=true ! pocketsphinx name=asr ! appsink sync=false name=appsink')
- #pipeline=gst.parse_launch('pulsesrc ! tee name=t ! queue ! audioconvert ! audioresample ! vader name=vad auto-threshold=true ! pocketsphinx name=asr ! appsink sync=false name=appsink t. queue ! audioconvert ! audioresample ! wavenc ! filesink location=o.wav')
- asr=pipeline.get_by_name('asr')
- asr.connect('result', result)
- #asr.set_property('lm', '1.lm')
- #asr.set_property('dict', '1.dic')
- asr.set_property('configured', True)
- pipeline.set_state(gst.STATE_PLAYING)
- gtk.main()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement