how to play a wav file in qt [duplicate]
Possible Duplicate:
How to play sound with Qt 开发者_运维技巧
can anyone tell me how to play a .wav file in qt
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
use QSound class to play a wave file. If you need to play more formats take a look at phonon
精彩评论