You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

升级Windows 11后PySide6 6.6.3出现QtMultimedia后端缺失致音频无法播放

Windows 11下PySide6 6.6.3音频播放失败问题

升级至Windows 11后,音频无法播放,弹出如下警告:

No QtMultimedia backends found. Only QMediaDevices, QAudioDevice, QSoundEffect, QAudioSink, and QAudioSource are available.
Failed to initialize QMediaPlayer "Not available"

最小复现代码示例

from PySide6.QtMultimedia import QMediaPlayer, QAudioOutput
from PySide6.QtWidgets import QMainWindow, QApplication
from PySide6.QtCore import QUrl


class MainWindow(QMainWindow):
    def __init__(self):
        super().__init__()

        self.media = QMediaPlayer(self)
        self.output = QAudioOutput(parent=self)
        self.media.setAudioOutput(self.output)
        self.media.setSource(QUrl.fromLocalFile("files/media/theme.mp3"))

    def showEvent(self, e) -> None:
        self.media.play()
        super().showEvent(e)


if __name__ == '__main__':
    app = QApplication()
    window = MainWindow()
    window.show()
    app.exec()

环境信息

  • Python 3.11
  • Windows 11 Pro 23H2 22631.3296
  • PySide6 6.6.3

补充说明

查询得知QtMultimedia默认后端应为DirectShow,且系统已安装DirectX,但问题仍存在。将PySide6回退至6.6.0版本后问题解决,但希望能在最新版本中正常运行。


内容的提问来源于stack exchange,提问作者Gygabrain

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.06.26 17:55:06