Cant play sound on Windows 7 [Solved]
Im using this code to play a sound file on linux, and it work. But in windows 7 it doesnt. Any one knows why?
- Phonon::MediaObject *mediaObject = Phonon::createPlayer(Phonon::NoCategory, Phonon::MediaSource("sound.ogg"));
- mediaObject->play();
- delete mediaObject;
10 replies
I discovered why isnt working, Im using .qrc file to store my audio files and playing by it like this
- Phonon::MediaObject *mediaObject = Phonon::createPlayer(Phonon::NoCategory,
- Phonon::MediaSource(":/sound.ogg"));
- mediaObject->play();
In linux it work, in windows it only work if I set the MediaSource like this
- Phonon::MediaObject *mediaObject = Phonon::createPlayer(Phonon::NoCategory, Phonon::MediaSource("./sound.ogg"));
You must log in to post a reply. Not a member yet? Register here!



