• 9187阅读
  • 3回复

【提问】帮忙看看我的程序有什么问题 [复制链接]

上一主题 下一主题
离线springmagus
 

只看楼主 倒序阅读 楼主  发表于: 2005-08-24
这个程序可以顺利编译通过,但就是不能达到预想的效果(play函数发出声音),
这个简单的程序是我照着Qt自带的编程手册所提供的关于QSound类的例子写的。
#include <qmessagebox.h>
#include <qfiledialog.h>
#include <qstring.h>
#include <qsound.h>

void mp3Form::play_clicked()
{
  QMessageBox MessageBox;
  /*MessageBox.information(this, "Application name",
  "Unable to find the user preferences file.\n"
  "The factory default will be used instead.");       */

  QFileDialog FileDialog;
  QString String;
  //QSound Sound;
  String = FileDialog.getOpenFileName("/",
                  "*.wav",
                  this,
                  "open file dialog",
                  "Choose a file" );
  MessageBox.information(this, "Application name",
  String );

  QSound::play(String);

}
[ 此贴被XChinux在2005-08-25 09:49重新编辑 ]
离线giscn
只看该作者 1楼 发表于: 2005-08-25
昨天你好象说过是x11下是吧,
确认NAS装了吗?
http://nzt.spaces.live.com
离线springmagus

只看该作者 2楼 发表于: 2005-08-26
从Qt的文档来看,NAS是一定要装的,否则当然出不来声音.
但是我怎么才能知道我的系统上装没装 NAS,我用的系统是 FC4(2.6.11).
要是没装,我去哪里下载呢?
离线aiken
只看该作者 3楼 发表于: 2005-08-29
装了之后还要重新编译qt的 建议用oss简单实用
qt的sound功能太弱了
快速回复
限100 字节
 
上一个 下一个