summaryrefslogtreecommitdiff
path: root/voctocore/lib/audiomix.py
blob: 24c34a9de3703379514ca0f3292538def23f1a7d (plain)
  1. #!/usr/bin/python3
  2. import logging
  3. from gi.repository import Gst
  4. from enum import Enum
  5. from lib.config import Config
  6. class AudioMix(object):
  7. log = logging.getLogger('AudioMix')
  8. mixingPipeline = None
  9. caps = None
  10. names = []
  11. selectedSource = 0
  12. def __init__(self):
  13. self.caps = Config.get('mix', 'audiocaps')
  14. pipeline = """
  15. interaudiosrc channel=audio_cam1_mixer !
  16. {caps} !
  17. queue !
  18. interaudiosink channel=audio_mix
  19. """.format(
  20. caps=self.caps
  21. )
  22. self.log.debug('Creating Mixing-Pipeline:\n%s', pipeline)
  23. self.mixingPipeline = Gst.parse_launch(pipeline)
  24. self.mixingPipeline.set_state(Gst.State.PLAYING)