开发者

how to play a wav file in qt [duplicate]

This question already has answers here: Closed 10 years ago.

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

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜