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;
@ -
Yes I have ogg, and I tested with .wav and dont work.
Andre, This is just a simplified test case, in my real code delete is not so close from createplayer(). -
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"));
@ -
this dont need to be reported as a bug? since it work in on way on windows and another in linux?
-
This is a pity, I liked the way qt make sounds builtin the app