Forums

OverviewFelgo 2 Support (Qt 5) › Audio isn't played

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #22525

    sAMA SAMA

    I have both audios:

    
    
    Audio{
                    id: win             //played when the right rectangle is chosen
                    source: "../android/assets/win.wav"
                }
                Audio{
                    id: lost                //played when the wrong rectangle is chosen
                    source: "../android/assets/lost.wav"
                }

     

    and they both should be played under these conditions:

     

    MouseArea{
                                        id: touch_handler
                                        anchors.fill: parent
                                        onClicked: {
                                            if (model.squareColor === pl){  //if rectangle color is correct
                                                win.play()    //win plays
                                            }
                                            else {
                                                lost.play()   //lost plays
                                            }
                                        }
                                    }

     

    why is that? I already added

    QT += multimedia multimediawidgets

    is there something else?

    #22533

    Alex
    Felgo Team

    Hi,

    what platform are you testing on? Is there any error message displayed, e.g. if the wav files maybe have an unsupported type.

    Cheers,
    Alex

    #22541

    sAMA SAMA

    alex.huber said:

    Hi,

    what platform are you testing on? Is there any error message displayed, e.g. if the wav files maybe have an unsupported type.

    Cheers,
    Alex

    Hi

    I’m testing it on android using the live client.

    There are no errors, I tried adding an mp3 file and didn’t work as well

    #22550

    Alex
    Felgo Team

    Ah, I just saw that you are putting the assets in the “android” folder. Is there any reason why? This folder is reserved for platform deployment specific files and is not sent to the Live Client. We recommend to put the files in the existing assets folder of your project.

    Cheers,
    Alex

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

RSS feed for this thread

You must be logged in to reply to this topic.

Voted #1 for:

  • Easiest to learn
  • Most time saving
  • Best support

Develop Cross-Platform Apps and Games 50% Faster!

  • Voted the best supported, most time-saving and easiest to learn cross-platform development tool
  • Based on the Qt framework, with native performance and appearance on all platforms including iOS and Android
  • Offers a variety of plugins to monetize, analyze and engage users
FREE!
create apps
create games
cross platform
native performance
3rd party services
game network
multiplayer
level editor
easiest to learn
biggest time saving
best support