python - Recording with valve in my gstreamer pipeline -
i have problem valve in pipeline :
self.pipeline = gst.parse_launch(' ! '.join(['autoaudiosrc', 'queue silent=false leaky=2 max-size-buffers=0 max-size-time=0 max-size-bytes=0', 'audioconvert', 'audioresample', 'audio/x-raw-int, rate=16000, width=16, depth=16, channels=1', 'tee name=t', 'queue', 'audioresample', 'audio/x-raw-int, rate=8000', 'vader name=vader auto-threshold=true', 'pocketsphinx lm=%s dict=%s name=listener' % (dir_path + '/pocketsphinx/lisa.lm',dir_path + '/pocketsphinx/lisa.dic'), 'fakesink dump=1 t.', 'valve name=valve drop=0', 'queue', 'flacenc', 'filesink async=0 location=' + self.recording]))
i know it's not best pythonic way create pipeline, it's readable.
setting 0 record mic flow in file , okay. want drop default, , open valve on fly depending event (listen keyword pocketsphinx), close valve again. don't seems work : file remains @ 0 bytes.
once pocketsphinx listen keyword, enable valve :
self.recording_valve.set_property('drop',false)
i tried give very short example of problem. maybe it's not located in part that's debug lead me.
to view entire project : https://github.com/seraf/lisa-client-linux/blob/pocketsphinx/lisa.tac
that call class : https://github.com/seraf/lisa-client-linux/blob/pocketsphinx/lib/listener.py
that call class : github /seraf/lisa-client-linux/blob/pocketsphinx/lib/recorder.py
thanks !
seems bit stupid, rewriting filesink file quickly, "watch" command, 1 second timeloop wasn't seeing change in file.
removing guilty line show me file filled correctly.
sorry noise.
Comments
Post a Comment