Details
-
Bug
-
Resolution: Out of scope
-
Not Evaluated
-
None
-
6.2.0
-
None
-
venv
Description
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)