mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-01-06 07:28:48 +00:00
6ef3a7273a
Original commit message from CVS: * examples/gst/wavenc.py: New example * Makefile.am (EXTRA_DIST): Add wavenc.py
22 lines
531 B
Python
22 lines
531 B
Python
#!/usr/bin/env python
|
|
import sys
|
|
import gst
|
|
|
|
def decode(filename):
|
|
output = filename + '.wav'
|
|
pipeline = ('filesrc location="%s"' + \
|
|
' ! spider ! wavenc ! ' + \
|
|
'filesink location="%s"') % (filename, output)
|
|
|
|
bin = gst.parse_launch(pipeline)
|
|
bin.set_state(gst.STATE_PLAYING)
|
|
while bin.iterate():
|
|
pass
|
|
bin.set_state(gst.STATE_NULL)
|
|
|
|
def main(args):
|
|
for arg in args[1:]:
|
|
decode(arg)
|
|
|
|
if __name__ == '__main__':
|
|
sys.exit(main(sys.argv))
|