From 6ef3a7273ad7e0a41f55761aabd8ef9fb832fd4b Mon Sep 17 00:00:00 2001 From: Johan Dahlin Date: Mon, 29 Mar 2004 10:20:02 +0000 Subject: [PATCH] examples/gst/wavenc.py: New example Original commit message from CVS: * examples/gst/wavenc.py: New example * Makefile.am (EXTRA_DIST): Add wavenc.py --- ChangeLog | 6 ++++++ Makefile.am | 1 + examples/gst/wavenc.py | 22 ++++++++++++++++++++++ 3 files changed, 29 insertions(+) create mode 100644 examples/gst/wavenc.py diff --git a/ChangeLog b/ChangeLog index 43f6c0f..a52612d 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2004-03-29 Johan Dahlin + + * examples/gst/wavenc.py: New example + + * Makefile.am (EXTRA_DIST): Add wavenc.py + 2004-03-24 Johan Dahlin * gst/gstmodule.c (init_gst): Add constants for GST_*SECOND. diff --git a/Makefile.am b/Makefile.am index 35c4fff..22e5add 100644 --- a/Makefile.am +++ b/Makefile.am @@ -23,6 +23,7 @@ EXTRA_DIST = \ examples/gst/lat.py \ examples/gst/rot13.py \ examples/gst/vorbisplay.py \ + examples/gst/wavenc.py \ examples/gstplay/player.py snap: diff --git a/examples/gst/wavenc.py b/examples/gst/wavenc.py new file mode 100644 index 0000000..40124f8 --- /dev/null +++ b/examples/gst/wavenc.py @@ -0,0 +1,22 @@ +#!/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)) -- 2.7.4