PDA

View Full Version : Qt multimedia



vuletic
30th September 2015, 16:04
Hello, I have just started using Qt Quick, and I wanted to test QtMultimedia library with following code:




import QtQuick 2.3
import QtQuick.Window 2.2
import QtMultimedia 5.0

Window {
visible: true

Text {
text: "Play!";
font.pointSize: 24;
width: 150; height: 50;

Audio {
id: playMusic
source: "C:\Users\whateverismyusername:)\Desktop\Example.og g"
}
MouseArea {
id: playArea
anchors.fill: parent
onPressed: { playMusic.play() }
}

}
}



but when I run it, application appears as expected, but when I click play audio doesn't start, any ideas what am I missing?

anda_skoa
30th September 2015, 16:13
Try forward slashes as path separator, back slashes are escape characters in most languages.

Cheers,
_

vuletic
30th September 2015, 16:21
Thanks, I'm used to forward slashes but when I'm on windows I always see path such as (C:\Users\user\Documents\test for ex.) so I assumed I had to use it like that, now it works fine if I play .wav file but if I try to play .ogg I get following error:
DirectShowPlayerService::doRender: Unresolved error code 80040218 and If I checked it correctly codec is problem here.