Dear All,
I want to play wave file in my application using Qt libraries 4.6.2.
I use the below code, i am calling QSound to play wave file placed in "/home/sky/1.wav" in button press event,however it doesn't work for me.can any one suggest the correct way to use.
The system shows that the sound facility is available.
void Widget::on_pushButton_clicked()
{
printf("Sound Facility is available\n");
else
printf("Sound Facility is not available\n");
QSound bells
("/home/sky/1.wav");
bells.play();
//QSound::play("/home/guest/QtTest/image_viewer/1.wav");
printf("Inside push Button\n");
}
void Widget::on_pushButton_clicked()
{
if(QSound::isAvailable ())
printf("Sound Facility is available\n");
else
printf("Sound Facility is not available\n");
QSound bells("/home/sky/1.wav");
bells.play();
//QSound::play("/home/guest/QtTest/image_viewer/1.wav");
printf("Inside push Button\n");
}
To copy to clipboard, switch view to plain text mode
Bookmarks