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.

Qt Code:
  1. void Widget::on_pushButton_clicked()
  2. {
  3.  
  4. if(QSound::isAvailable ())
  5. printf("Sound Facility is available\n");
  6. else
  7. printf("Sound Facility is not available\n");
  8. QSound bells("/home/sky/1.wav");
  9. bells.play();
  10. //QSound::play("/home/guest/QtTest/image_viewer/1.wav");
  11. printf("Inside push Button\n");
  12. }
To copy to clipboard, switch view to plain text mode