Learn what Felgo offers to help your business succeed. Start your free evaluation today! Felgo for Your Business

Forums

OverviewFelgo 3 Support (Qt 5) › No sound on iPad

Tagged: ,

Viewing 10 posts - 1 through 10 (of 10 total)
  • Author
    Posts
  • #8937

    Martin

    When I deploy my app to Android everything works: sound, music etc.

     

    When I deploy to my iPad, everything seems to be working, except no sounds/music.

     

    How do I start debugging this?

     

    #8944

    Alex
    Felgo Team

    Hi,

    Are you using the Felgo sound items or the Qt-realted ones? And one more question, are you using the sound files from a resource file (qrc) or from the assets folder? Which file formats are you using?

    You can also have a look at our demo games how we integrated sound effects and music into Felgo powered games.

    Cheers,

    Alex

    #8945

    Martin

    I’m using BackgroundMusic for the music.

    I’m using SoundEffectVPlay for the sounds.

    In each case, the source property is pointing to a .wav in ../../assets/wav

    I think that it’s based on what I saw in the examples (I started from MultiLevelMultiScene example).

     

     

        BackgroundMusic {
            id: backgroundMusic
            autoPlay: true
            volume: 0.9
            Behavior on source {
                NumberAnimation {
                    target: backgroundMusic; property: "volume";
                    from: 0; to: 0.9; duration: 4000;
                    easing: Easing.InQuint
                }
            }
        }
    
        state: "selectLevel"
        activeScene: selectLevelScene
    
        // state machine, takes care reversing the PropertyChanges when changing the state, like changing the opacity back to 0
        states: [
            State {
                name: "selectLevel"
                PropertyChanges {target: selectLevelScene; opacity: 1}
                PropertyChanges {target: window; activeScene: selectLevelScene}
                PropertyChanges {target: backgroundMusic;
                    source: "../assets/wav/levelselect.wav"}
            },

     

    Under android, I see lots of messages like:

     

    V/MediaPlayer-JNI(29416): native_setup
    V/MediaPlayer(29416): constructor
    V/MediaPlayer(29416): setListener
    V/MediaPlayer-JNI(29416): setVolume: left 1.000000  right 1.000000
    V/MediaPlayer(29416): MediaPlayer::setVolume(1.000000, 1.000000)
    V/MediaPlayer-JNI(29416): setDataSourceFD: fd 66
    V/MediaPlayer(29416): setDataSource(66, 10631840, 1228844)
    V/MediaPlayer(29416): setVideoSurfaceTexture
    V/MediaPlayer(29416): prepareAsync
    V/MediaPlayer(29416): message received msg=200, ext1=973, ext2=0

     

    I don’t see anything about sound under IOS.

     

    • This reply was modified 9 years, 2 months ago by  GreenAsJade.
    #8948

    Heini

    Hi,

    I experienced that espescially the SoundEffect/SoundEffectVplay element is not working reliable on mobile devices. After some playtime, on Android some play() calls where ignored. On iOS this may also happen when the app gets focus again after staying in background. For me this looks like a memory/resources management issue. Now I switched to Audio that does not show that behavior.

    #8962

    Martin

    Thanks for replying.  Can you clarify what you mean by “switched to Audio”?

     

    #8964

    Heini

    For playing soundeffects I am using the standart Qt “Audio” element (include Qt.Multimedia), where also Backgroundmusic is derived from. Its disadvantage is, that it is to slow for immediately repeated play calls (i.e. shots). So at the moment I can not see any satisfying solution for playing soundeffects on all platforms.

    #8965

    Alex
    Felgo Team

    Hi,

    for a recent project we were facing the same problem. The problem with the Audio element is not that it’s to “slow”, but if it is still playing (because the sound is too long), a play() call will not restart it, but gets ignored instead. We worked around it by using multiple Audio elements and toggle between them, so repetitive calls trigger different Audio elements. We modified the AudioManager from our FlappyBird demo game, to keep sound calls clean in the entities. Also don’t forget to check for settings.soundEnabled before playing the sound, since the Audio element is a standard Qt component.

    I hope this works for you too.

    Cheers,
    Alex

    • This reply was modified 9 years, 1 month ago by  Alex.
    • This reply was modified 9 years, 1 month ago by  Alex.
    #9003

    Martin

    I just accidentally discovered the embarrassing reason why sound was not playing on the (newly acquired) iPad I was trying,

     

    Guess…

     

    #9005

    Alex
    Felgo Team

    You were listening to unimaginably loud heavy metal music and therefore weren’t able to hear the iPads sound!

    #9012

    Martin

    Actually, it is a little bit of a trap for “young players”  (not that I’m actually young).

    The iPad has a little button at the top-right-rear, which is “Silence Ringer”.     When you switch it, it says “Ringer Silent”.

    Well…. unbeknown to me, that button silences the game sound as well as notifications.

    I do recall switching that switch “on” when I first got the device, because at that time it was for my parents, and they didn’t want to be getting rings (they weren’t expecting any anyhow).

    When I got no sound from my game, I tried other ways of getting sound: I went to YouTube for example.   That still works even with the “silence” button on, which is why I thought it was the “game’s fault” that there was no sound.

    The other day, I noticed that button again for some reason and a light bulb dinged on….

     

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

RSS feed for this thread

You must be logged in to reply to this topic.

Qt_Technology_Partner_RGB_475 Qt_Service_Partner_RGB_475_padded