I’m trying to build a music player and have this button to play a sound:
AppButton{
width: 150
height: 50
text: "Click Me!";
anchors.horizontalCenter: parent.horizontalCenter
anchors.verticalCenter: parent.verticalCenter
MediaPlayer {
id: playMusic
source: "E:/Breaeze/SampleAudio_0.mp3" //audio file location
}
MouseArea {
id: playArea
anchors.fill: parent
onPressed: { playMusic.play() }
}
}
My audio can’t be played when I use a directory on my local PC and gives me this error:
DirectShowPlayerService::doSetUrlSource: Unresolved error code 0x80070002 ()
But when I use this URL instead :
https://sample-videos.com/audio/mp3/crowd-cheering.mp3
it works why?