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.ogg"
}
MouseArea {
id: playArea
anchors.fill: parent
onPressed: { playMusic.play() }
}
}
}
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.ogg"
}
MouseArea {
id: playArea
anchors.fill: parent
onPressed: { playMusic.play() }
}
}
}
To copy to clipboard, switch view to plain text mode
but when I run it, application appears as expected, but when I click play audio doesn't start, any ideas what am I missing?
Bookmarks