play a sound in application
Solved
General and Desktop
-
Hi.
i want to add a sound effect to my app
that when i clicked on a push button that sound Run
I Wrote this code but sound dose not play!
what i must do?void MainWindow::on_pushButton_2_clicked() { QSound bts("/sounds/cartoon005.wav"); bts.play(); }
-
Hi,
Widget::Widget(QWidget *parent)
: QWidget(parent)
{
glayout = new QGridLayout(this);
pb_b1 = new QPushButton("sound");
glayout->addWidget(pb_b1);
connect(pb_b1,SIGNAL(clicked()),this,SLOT(SLT_playSound()));
}void Widget:: SLT_playSound(){
QSound::play("D:/pthinks/trash/button_sound/telugu4.wav");
}