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

QAudioSink Poor Quality / Distortion

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Out of scope
    • Icon: Not Evaluated Not Evaluated
    • None
    • 6.2.0
    • PySide
    • None
    • venv
    • Windows

      Not sure if this issue is with QT or PySide6 but thought I'd report it here. PySide6 is installed in a venv.

      I'm playing raw PCM s16le stereo audio using QAudioSink. On Linux, the audio sounds good. On Windows 10, the audio has lots of distortion. I've dumped the raw PCM stream to a file and it sounds good when played back through Audacity using the same audio device. The audio is nowhere close to clipping according to Audacity.

      QAudioDevice.isFormatSupported() returns True when passing in the audio format.

       

      Audio Format:

      <PySide6.QtMultimedia.QAudioFormat( 48000 Hz, 2 Channels, Int16 Format>

      Using default device:

      Description: Speakers (Realtek(R) Audio)
      Preferred Format: <PySide6.QtMultimedia.QAudioFormat( 44100 Hz, 2 Channels, Int16 Format>

      Maximum Sample Rate: 96000

       

      Code

      from PySide6 import QtMultimedia
      
      audio_device = QtMultimedia.QMediaDevices.defaultAudioOutput()
      audio_format = QtMultimedia.QAudioFormat()
      audio_format.setChannelCount(2)
      audio_format.setSampleRate(48000)
      audio_format.setSampleFormat(QtMultimedia.QAudioFormat.Int16)
      audio_format.setChannelConfig(QtMultimedia.QAudioFormat.ChannelConfigStereo)
      audio_output = QtMultimedia.QAudioSink(audio_device, format=audio_format)
      audio_output.setBufferSize(3840)
      audio_buffer = audio_output.start()
      audio_buffer.write(data)

        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

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

              Created:
              Updated:
              Resolved:

                There are no open Gerrit changes