• 6270阅读
  • 2回复

急!!!!Linux下用Qsound没办法播放声音 [复制链接]

上一主题 下一主题
离线ch19860304
 
只看楼主 倒序阅读 楼主  发表于: 2009-07-19
— 本帖被 XChinux 从 General Qt Programming 移动到本区(2011-01-02) —
Linux下用Qsound没办法播放声音,QSound::isAvailable()返回的居然是false,我的linux系统具体还要装什么东西吗?求大虾给我讲讲呀!!!!!!


#include <QtGui>
#include <QApplication>
#include <QSound>

int main(int argc, char *argv[])
{
    QApplication app(argc, argv);

    if(QSound::isAvailable() == true)
    {
        QSound bells("mysounds/apple.mp3");
        bells.play();
    }
    else
    {
        printf("not available\n");
    }
    /*Imagewindow window ;
    window.show();*/

    return app.exec();
}
离线wangshanshi
只看该作者 1楼 发表于: 2009-07-22
mp3格式的QT不支持吧
离线landuochong

只看该作者 2楼 发表于: 2009-07-22
你可以不加判断,先播一下试试,不过mp3格式好像不支持,wmv,audio支持
快速回复
限100 字节
 
上一个 下一个