用Qt6时,使用SoundEffect添加wav文件时,没有声音,且提示“无法启动采样器”
错误提示:qt.multimedia.audiooutput: Failed to setup resampler
multimedia模块也添加了,还是不行。声音文件的路径都是对的
代码如下,请大家指点!
#include "widget.h"
#include "ui_widget.h"
#include <QSoundEffect>
Widget::Widget(QWidget *parent)
: QWidget(parent)
, ui(new Ui::Widget)
{
ui->setupUi(this);
QSoundEffect * startSound = new QSoundEffect(this);
startSound->setSource(QUrl::fromLocalFile(":/TapButtonSound.wav"));
startSound->play();
}
Widget::~Widget()
{
delete ui;
}
是不是用的6.4.1windows版,之前在英文论坛上看到别人说6.4.1有这个bug,6.4.0没有
https://bugreports.qt.io/browse/QTBUG-108383
你好 我也遇到这个问题了 请问你的解决了吗