Playing sounds on Andoird Exporter causes brief drop in framerate

Welcome to our brand new Clickteam Community Hub! We hope you will enjoy using the new features, which we will be further expanding in the coming months.

A few features including Passport are unavailable initially whilst we monitor stability of the new platform, we hope to bring these online very soon. Small issues will crop up following the import from our old system, including some message formatting, translation accuracy and other things.

Thank you for your patience whilst we've worked on this and we look forward to more exciting community developments soon!

Clickteam.
  • Hey guys,

    So I've had this issue for quite a while now. I think I've tried everything. For some reason, my android game runs smoothly when all sounds are disabled. As soon as I have a single sound sample executed during runtime, I get a sudden but brief drop in frames (from 60 to about 30-40). I understand that it isn't a huge drop, but it causes some conflict with some of the game mechanics. Also, it doesn't exactly look nice.

    As reference, I'm going to use the Balloon Pop sound effect. The sound effect is a MONO, .OGG, 32HZ, 12KB file. It is run using the +Play Sample balloonPop on Channel #6. It is under an Always condition with an -Only one action when event loops (because it checks when the balloon's Y value is lower than a given value).

    "Compress Sounds" Ticked
    "Multi-samples" Ticked
    "Play Sounds Over Frames" Ticked

    Everything else related to sounds is left unticked.

    That's about it, I guess.

    Any suggestions?

    Just wanted to reiterate that the game runs EXTREMELY smoothly without sounds being played. Like butter smooth. 60 fps at all times.

    Thanks, guys.

  • Wow, Jeff, it works! I'm speechless, it's such a simple fix. I even made sure to triple check the fix with all my other sounds and it works. It has gotten rid of all the lag.

    But I'm confused, why would it trigger the sound effect more than once? The Balloon is only travelling up, when its Y value is lower than, say, 200 (+only one action when event loops), the sound effect is played and the balloon is destroyed. I don't see how it would trigger more than once?

    Of course it works now, so it won't matter really why it does, but the knowledge of the fix might circumvent future problems. :p

    Thanks again for your time! You've been a great help -- as always, of course.

  • Can you 'undo' what you did and post a screenshot of your Event List Editor with that event in view? It might help to understand why it was happening...

    Game Launcher Creator V3 - Please login to see this link.
    Bespoke Software Development - Please login to see this link.
    Learn Clickteam Fusion 2.5 - Please login to see this link.

    Danny // Clickteam

  • Hi Danny,

    Yes, of course. Sorry for the late reply.

    Please login to see this attachment.

    Here is how it was before. The other 2 actions are simply a "Destroy" and a "Set internal flag 0 to on".

    After inserting the "Is Channel 6 not playing?" condition, the lag went away. Not sure how it fixed it, but it did.

    Any ideas?

  • I just think the sound engine was trying to play the sound again every time the Y changed and just overloaded it.

    I am surprised you couldn't hear it echoing when the app ran -- That is what seems to happen in the PC runtime when a person triggers a sound over and over very rapidly.

    Please login to see this link.

  • I don't think that's what was happening, at least -- if it was -- i certainly didn't notice it.

    Before the fix, the sounds had absolute no echo and sounded just fine. The structure of the code shouldn't allow for the action to repeat more than once, so long as (+only one action when event loops) is applied. The balloon never re-enters the state of being lower than its alterable value A (in this case named "popPosition").

    There must be something else to it. Perhaps it triggers it an extra 2 or 3 times before it stops? Who knows.

    Either way, it fixed the lag. So I'm grateful.

  • Well is going to play again every time the Y value is lower then 200

    Y is 199 the sound will play
    If the next event loop the Y is 198 the condition will be true again and play the sound again
    Of course with the one action per event loop in the event it will only play once for every Y value.

    Just writing this for others so they can see what I was thinking -- I am glad you got your issue sorted out in any event.

    Please login to see this link.

  • Hey guys,

    Unfortunately, I'm still having issues with this. Every time a sound is played, there's a slight effect on FPS, dropping to about 45 from 60.

    Example:
    When the apple collides with basket, play sound "Catch" on channel 1. (Catch is a .ogg file, 44100hz, mono, 32 bit (float), 13.2kb).

    This drops the fps to about 45 for an instant. Interestingly, if another collision occurs while the sound (catch) is still playing, the sound restarts but there is no drop in fps. Essentially, the fps drop occurs only when the sound isn't playing and the catch occurs.

    "Compress Sounds" Ticked
    "Multi-samples" Ticked
    "Play Sounds Over Frames" Ticked
    Force 'play from disk' for sounds larger than: 5 seconds

    Any ideas?

    This is getting just so frustrating.

    Samer.

  • Hey Fernando,

    The length of the sound is 2.34s. I've tried reducing the "play from disk" to 1 second, but that didn't solve the issue. I've also tried using different sound effects to see if it was the sound file itself, but no luck.

    Samer.

  • ok, now I understand please do something in the sound dialog set this sound as "play form disk", not matter the second in android properties.

    OGG is not fast decode and play when is related to soundpool so you have ot go to mediaplayer and this is done setting the flag "Play from disk" in sound dialog inside data elements

    Regards,


    Fernando Vivolo

    ... new things are coming ...

  • Hey Fernando,

    I didn't know that about .ogg files, thanks for the interesting info.

    Having said that, I've tried your suggestion, I set the Catch sound to "play from disk" instead of "Preload" but that -- unfortunately -- didn't fix the issue.

    I've tried converting the file into an .mp3, but I didn't get any luck. I also tried .wav but mmf didn't accept that altogether. Perhaps because it went from 14kb to 353kb...

    Any more ideas?

    Samer.

Participate now!

Don’t have an account yet? Register yourself now and be a part of our community!