Adding gst-python package
[platform/upstream/gst-python.git] / testsuite / old / test_audio.py
1 # -*- Mode: Python -*-
2 # vi:si:et:sw=4:sts=4:ts=4
3 #
4 # gst-python - Python bindings for GStreamer
5 # Copyright (C) 2009 Edward Hervey <edward.hervey@collabora.co.uk>
6 #
7 # This library is free software; you can redistribute it and/or
8 # modify it under the terms of the GNU Lesser General Public
9 # License as published by the Free Software Foundation; either
10 # version 2.1 of the License, or (at your option) any later version.
11 #
12 # This library is distributed in the hope that it will be useful,
13 # but WITHOUT ANY WARRANTY; without even the implied warranty of
14 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
15 # Lesser General Public License for more details.
16 #
17 # You should have received a copy of the GNU Lesser General Public
18 # License along with this library; if not, write to the Free Software
19 # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301  USA
20
21 from common import gobject, gst, unittest, TestCase
22
23 class Audio(TestCase):
24
25     def testBufferclip(self):
26         assert hasattr(gst.audio, "buffer_clip")
27         # create a segment
28         segment = gst.Segment()
29         gst.debug("Created the new segment")
30         # we'll put a new segment of 500ms to 1000ms
31         segment.set_newsegment(False, 1.0, gst.FORMAT_TIME, 0, -1, 0)
32         gst.debug("Initialized the new segment")
33         # create a new dummy buffer
34         b = gst.Buffer("this is a really useless line")
35         gst.debug("Created the buffer")
36         # clip... which shouldn't do anything
37         b2 = gst.audio.buffer_clip(b, segment, 44100, 8)
38         gst.debug("DONE !")