Here are some helpers for dealing with gstreamer
Sample gstreamer usage
# default audio src (does not work on mac mini with ubuntu)
gconfaudiosrc
# mac mini source from usb microphone
osssrc device=/dev/audio1
# run from file
filesrc location=current.raw blocksize=2048 ! audioparse rate=8000 channels=1 width=16
# save to file
! filesink location=filtered.raw
# play on speakers
! autoaudiosink
# audio format used
! audioconvert ! audioresample ! audio/x-raw-int rate=8000 channels=1 width=16
# active noice cancelling
! speexanc
# voice activation detector (part of pocketsphinx)
! vader name=vad auto-theshold=1
# voice recognition using pocketsphinx
! pocketsphinx name=asr lm=commands.lm dict=commands.dic configured=1
Sample gstreamer pipeline
PIPELINE="
osssrc device=/dev/audio1
! audioconvert
! audioresample
! audio/x-raw-int rate=8000 channels=1 width=16
! speexanc
! vader name=vad auto-theshold=1
! pocketsphinx name=asr lm=commands.lm dict=commands.dic configured=1
! fakesink
"
Splitting gstreamer pipeline into two parallel ones using tee
gst-launch audiotestsrc ! tee name=t ! queue ! speexanc silent=false ! autoaudiosink t. ! queue ! filesink location=file.raw
NEED TO SET leaky=1
http://www.oz9aec.net/index.php/gstreamer/410-x264enc-problem-in-gstreamer-video-switcher-solved
Today I learned how to fix it and make x264enc work in this pipeline, thanks to an email on the GStreamer-devel mailing list . In his email Senthil writes that “The queue will block the supplier when there is no more space in it. … Since x264enc may take more time to consume, setting leaky property (as suggested in the doc) on the queue before xvimagesink might help” – and indeed it does!
! tee name=t ! queue leaky=1 ! filesink location=log.raw t. ! queue leaky=1