你好,我试图在 qt 上播放音乐,我将点击一个按钮“jouer”来播放音乐,这是我的代码:
#include "jouer.h"
#include "ui_jouer.h"
Jouer::Jouer(QWidget *parent) :
QDialog(parent),
ui(new Ui::Jouer)
{
ui->setupUi(this);
ui->tabmusic->setModel(tmpmusique.afficher()); //show data base
player = new QMediaPlayer(this);
connect(player, &QMediaPlayer::positionChanged, this, &Jouer::on_positionChanged);
connect(player, &QMediaPlayer::durationChanged, this, &Jouer::on_durationChanged);
}
Jouer::~Jouer()
{
delete ui;
}
void Jouer::on_pushButton_3_clicked()
{
close();
}
void Jouer::on_pushButton_2_clicked()
{
jouertemps = new Musiqueavectemps(this); //go to another window
jouertemps->show();
}
void Jouer::on_pushButton_clicked() //that's the playing button where there is the error
{
player->setMedia(QUrl::fromLocalFile("C:\\Users\\Louay\\Desktop\\Music\\1.mp3"));
player->setVolume(50);
player->play();
}
Run Code Online (Sandbox Code Playgroud)
它编译正确,但是当我单击按钮“jouer”(jouer 表示法语中的播放)时,它显示了一个错误,即 DirectShowPlayerService::doRender: Unresolved error code 0x80040266 () 我在互联网上对此类错误进行了一些搜索未解决的错误代码 0x...()
好吧,它说我的错误 0x80040266() 是因为:引脚无法连接,因为它们不支持相同的传输。例如,上游过滤器可能需要 IAsyncReader 接口,而下游过滤器需要 IMemInputPin。
DirectShowPlayerService 有很多错误,我只是解释了我的类型的原因,它与其他回答的问题不同......我不知道如何解决这个......请不要关闭这篇文章
谁能帮帮我
谢谢
| 归档时间: |
|
| 查看次数: |
8455 次 |
| 最近记录: |