home *** CD-ROM | disk | FTP | other *** search
/ Mac Easy 2010 May / Mac Life Ubuntu.iso / casper / filesystem.squashfs / usr / share / gst-python / 0.10 / examples / audio-controller.pyc (.txt) < prev    next >
Encoding:
Python Compiled Bytecode  |  2009-04-20  |  1.2 KB  |  31 lines

  1. # Source Generated with Decompyle++
  2. # File: in.pyc (Python 2.6)
  3.  
  4. import pygst
  5. pygst.require('0.10')
  6. import gst
  7. import time
  8.  
  9. def main():
  10.     pipeline = gst.Pipeline('audiocontroller')
  11.     src = gst.element_factory_make('audiotestsrc', 'src')
  12.     sink = gst.element_factory_make('alsasink', 'sink')
  13.     pipeline.add(src, sink)
  14.     src.link(sink)
  15.     control = gst.Controller(src, 'freq', 'volume')
  16.     control.set_interpolation_mode('volume', gst.INTERPOLATE_LINEAR)
  17.     control.set_interpolation_mode('freq', gst.INTERPOLATE_LINEAR)
  18.     control.set('volume', 0, 0)
  19.     control.set('volume', 2 * gst.SECOND, 1)
  20.     control.set('volume', 4 * gst.SECOND, 0)
  21.     control.set('volume', 6 * gst.SECOND, 1)
  22.     control.set('freq', 0, 440)
  23.     control.set('freq', 3 * gst.SECOND, 3000)
  24.     control.set('freq', 6 * gst.SECOND, 880)
  25.     pipeline.set_state(gst.STATE_PLAYING)
  26.     time.sleep(7)
  27.  
  28. if __name__ == '__main__':
  29.     main()
  30.  
  31.