summaryrefslogtreecommitdiff
path: root/voctocore/lib/failaudiosrc.py
blob: 0ce885ea63316b2f2f498e959d22f407907dd5f6 (plain)
  1. #!/usr/bin/python3
  2. import time, logging
  3. from gi.repository import GLib, Gst
  4. from lib.config import Config
  5. class FailAudioSrc(Gst.Bin):
  6. log = logging.getLogger('FailAudioSrc')
  7. def __init__(self, idx, name):
  8. super().__init__()
  9. # Create elements
  10. self.failsrc = Gst.ElementFactory.make('audiotestsrc', None)
  11. # Add elements to Bin
  12. self.add(self.failsrc)
  13. # Set properties
  14. self.failsrc.set_property('freq', 400+idx*50)
  15. # Add Ghost Pads
  16. self.add_pad(
  17. Gst.GhostPad.new('src', self.failsrc.get_static_pad('src'))
  18. )