Find the Best Demos and Examples

Check out this quick tour to find the best demos and examples for you, and to see how the Felgo SDK can help you to develop your next app or game!

Forums

OverviewFelgo 2 Support (Qt 5) › MediaPlayer can't play audio file

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #21693

    sAMA SAMA

    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?

    #21708

    Alex
    Felgo Team

    Hi,

    what operating system are you using? I just tried your example on Windows 10 and it works for me.

    Note that for local files, you should also add

    file:///

    as prefix, like “file:///E:/Breaeze/SampleAudio_0.mp3”.

    Please also make sure that your path is correct. If you start typing with “file:///” Qt Creator will also allow you to navigate to your file while typing.

    You can also Google for e.g. “Qt DirectShowPlayerService::doSetUrlSource: Unresolved error” to find more help.

    Cheers,
    Alex

Viewing 2 posts - 1 through 2 (of 2 total)

RSS feed for this thread

You must be logged in to reply to this topic.