mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-11-27 20:21:24 +00:00
4a24e19c16
Original commit message from CVS: Put it in a thread and run it in a mainloop
20 lines
541 B
Python
20 lines
541 B
Python
#!/usr/bin/env python
|
|
import sys
|
|
import gst
|
|
|
|
def decode(filename):
|
|
output = filename + '.wav'
|
|
pipeline = ('{ filesrc location="%s" ! spider ! audio/x-raw-int,rate=44100,stereo=2 ! wavenc ! '
|
|
'filesink location="%s" }') % (filename, output)
|
|
|
|
bin = gst.parse_launch(pipeline)
|
|
bin.set_state(gst.STATE_PLAYING)
|
|
bin.connect('eos', lambda bin: gst.main_quit())
|
|
gst.main()
|
|
|
|
def main(args):
|
|
for arg in args[1:]:
|
|
decode(arg)
|
|
|
|
if __name__ == '__main__':
|
|
sys.exit(main(sys.argv))
|