-2

Possible Duplicate:
How to play sound with Qt

can anyone tell me how to play a .wav file in qt

Community
  • 1
  • 1
yamuna mathew
  • 87
  • 2
  • 5

2 Answers2

1

I had some problems with qsound (it didn't work on my machine) so I needed to switch to Phonon. It's easy to use:

Phonon::MediaObject* _music;
_music = Phonon::createPlayer(Phonon::MusicCategory, Phonon::MediaSource(filename));
_music->play();

or better have a look into the doc

Flexo
  • 87,323
  • 22
  • 191
  • 272
Reto ODT
  • 341
  • 2
  • 3
0

use QSound class to play a wave file. If you need to play more formats take a look at phonon

Kamil Klimek
  • 12,884
  • 2
  • 43
  • 58