Uploaded image for project: 'Qt for Python'
  1. Qt for Python
  2. PYSIDE-2695

macOS: .setWindowCapture() and .setAudioInput() don't work together

    XMLWordPrintable

Details

    • Bug
    • Resolution: Out of scope
    • Not Evaluated
    • None
    • 6.7.0
    • PySide
    • None
    • MacOS arm64
    • macOS

    Description

      Steps to reproduce:

      • Run mictest.py
      • Press record
      • Talk into microphone
      • Press record to stop
      • Play sound file stored under ~/Music; check if sound is audible

      Hello! So basically, when trying out the new WindowCapture feature on a QMediaCaptureSession, no audio works

      So to be clear, I am able to record a screen capture alright, there's just no audio from my microphone which I set as the audio input

      When using camera video capture instead of window capture, both video and audio work fine

      Is this a bug? How do I get audio input to work while doing a window capture?

      Example snippet:

       
      self.captureSession = QMediaCaptureSession()
      self.windowCapture = QWindowCapture()
      windows = QWindowCapture.capturableWindows()
      for win in windows:
      print(win.description())
      if "YouTube" in win.description():
      self.windowCapture.setWindow(win)
      self.windowCapture.start()
      self.captureSession.setWindowCapture(self.windowCapture)
      self.captureSession.setAudioInput(self.m_audio) # This line seems to do nothing when using WindowCapture
      self.captureSession.setRecorder(self.m_mediaRecorder)
      self.m_mediaRecorder.record()
      // record for a bit
      self.windowCapture.stop()
      self.m_mediaRecorder.stop()
      

       
      // resulting video has no sound, how do I fix that to either get sound from the window, or from my Microphone?

      Attachments

        1. mictest.py
          1 kB
        2. requirements_failing.txt
          0.1 kB
        3. requirements_working.txt
          0.1 kB
        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

        Activity

          People

            crmaurei Cristian Maureira-Fredes
            pjohnst5 Paul Johnston
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes