mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-11-27 12:11:13 +00:00
examples/gst/wavenc.py: New example
Original commit message from CVS: * examples/gst/wavenc.py: New example * Makefile.am (EXTRA_DIST): Add wavenc.py
This commit is contained in:
parent
15f1eb48cf
commit
6ef3a7273a
3 changed files with 29 additions and 0 deletions
|
@ -1,3 +1,9 @@
|
||||||
|
2004-03-29 Johan Dahlin <johan@gnome.org>
|
||||||
|
|
||||||
|
* examples/gst/wavenc.py: New example
|
||||||
|
|
||||||
|
* Makefile.am (EXTRA_DIST): Add wavenc.py
|
||||||
|
|
||||||
2004-03-24 Johan Dahlin <johan@gnome.org>
|
2004-03-24 Johan Dahlin <johan@gnome.org>
|
||||||
|
|
||||||
* gst/gstmodule.c (init_gst): Add constants for GST_*SECOND.
|
* gst/gstmodule.c (init_gst): Add constants for GST_*SECOND.
|
||||||
|
|
|
@ -23,6 +23,7 @@ EXTRA_DIST = \
|
||||||
examples/gst/lat.py \
|
examples/gst/lat.py \
|
||||||
examples/gst/rot13.py \
|
examples/gst/rot13.py \
|
||||||
examples/gst/vorbisplay.py \
|
examples/gst/vorbisplay.py \
|
||||||
|
examples/gst/wavenc.py \
|
||||||
examples/gstplay/player.py
|
examples/gstplay/player.py
|
||||||
|
|
||||||
snap:
|
snap:
|
||||||
|
|
22
examples/gst/wavenc.py
Normal file
22
examples/gst/wavenc.py
Normal file
|
@ -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))
|
Loading…
Reference in a new issue