문제

I have a problem with the valve in my 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 the best pythonic way to create the pipeline, but it's the most readable.

Setting it to 0 record the mic flow in my file and everything is okay. But I want to drop it by default, and open the valve on the fly depending an event (listen a keyword with pocketsphinx), then close this valve again. But it don't seems to work : my file remains at 0 bytes.

Once pocketsphinx listen the keyword, I enable the valve with :

self.recording_valve.set_property('drop',False)

I tried to give a very very short example of the problem. Maybe it's not located in this part but that's where my debug lead me.

To view the entire project : https://github.com/Seraf/LISA-CLIENT-Linux/blob/pocketsphinx/lisa.tac

that call this class : https://github.com/Seraf/LISA-CLIENT-Linux/blob/pocketsphinx/lib/listener.py

that call this class : github /Seraf/LISA-CLIENT-Linux/blob/pocketsphinx/lib/recorder.py

Thanks for your help !

도움이 되었습니까?

해결책

Seems a bit stupid, but I was rewriting my filesink file very quickly, so the "watch" command, even with a 1 second timeloop wasn't seeing the change in the file.

Removing the guilty line show me that the file was filled correctly.

Sorry for the noise.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top