标题:【提问】帮忙看看我的程序有什么问题
作者:springmagus
日期:2005-08-24 16:52
内容:
这个程序可以顺利编译通过,但就是不能达到预想的效果(play函数发出声音),
这个简单的程序是我照着Qt自带的编程手册所提供的关于QSound类的例子写的。
#include
#include
#include
#include
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);
}
#1 [giscn 08-25 10:17]
昨天你好象说过是x11下是吧,
确认NAS装了吗?
#2 [springmagus 08-26 11:59]
从Qt的文档来看,NAS是一定要装的,否则当然出不来声音.
但是我怎么才能知道我的系统上装没装 NAS,我用的系统是 FC4(2.6.11).
要是没装,我去哪里下载呢?
#3 [aiken 08-29 08:47]
装了之后还要重新编译qt的 建议用oss简单实用
qt的sound功能太弱了