User Tag List

Page 1 of 2 1 2 LastLast
Results 1 to 10 of 16

Thread: Playing sounds on Andoird Exporter causes brief drop in framerate

  1. #1
    Clicker Fusion 2.5Android Export Module

    Join Date
    Jun 2014
    Location
    London, UK
    Posts
    96
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)

    Playing sounds on Andoird Exporter causes brief drop in framerate

    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.

  2. #2
    Clickteam Clickteam
    Jeff's Avatar
    Join Date
    Jun 2006
    Location
    Battle Ground Washington
    Posts
    11,822
    Mentioned
    7 Post(s)
    Tagged
    2 Thread(s)
    Hmmmm I would still wonder if the sound is getting triggered over and over -- Could you put in another check to only play the sound if its not currently playing and see if that has any effect?

  3. #3
    Clicker Fusion 2.5Android Export Module

    Join Date
    Jun 2014
    Location
    London, UK
    Posts
    96
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    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.

  4. #4
    Clickteam Clickteam
    Danny's Avatar
    Join Date
    Aug 2007
    Location
    United Kingdom
    Posts
    3,006
    Mentioned
    21 Post(s)
    Tagged
    2 Thread(s)
    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...
    Want to learn Clickteam Fusion 2.5?




  5. #5
    Clicker Fusion 2.5Android Export Module

    Join Date
    Jun 2014
    Location
    London, UK
    Posts
    96
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    Hi Danny,

    Yes, of course. Sorry for the late reply.

    Example.jpg

    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?

  6. #6
    Clickteam Clickteam
    Danny's Avatar
    Join Date
    Aug 2007
    Location
    United Kingdom
    Posts
    3,006
    Mentioned
    21 Post(s)
    Tagged
    2 Thread(s)
    Strange indeed. I'll make a note and give it a check tomorrow.
    Want to learn Clickteam Fusion 2.5?




  7. #7
    Clickteam Clickteam
    Jeff's Avatar
    Join Date
    Jun 2006
    Location
    Battle Ground Washington
    Posts
    11,822
    Mentioned
    7 Post(s)
    Tagged
    2 Thread(s)
    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.

  8. #8
    Clicker Fusion 2.5Android Export Module

    Join Date
    Jun 2014
    Location
    London, UK
    Posts
    96
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    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.

  9. #9
    Clickteam Clickteam
    Jeff's Avatar
    Join Date
    Jun 2006
    Location
    Battle Ground Washington
    Posts
    11,822
    Mentioned
    7 Post(s)
    Tagged
    2 Thread(s)
    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.

  10. #10
    Clicker Fusion 2.5Android Export Module

    Join Date
    Jun 2014
    Location
    London, UK
    Posts
    96
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    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.

Page 1 of 2 1 2 LastLast

Similar Threads

  1. Android version 6.0.1 framerate drop
    By mohdhafizal in forum Android Export Module 2.5
    Replies: 5
    Last Post: 29th August 2016, 08:48 PM
  2. Android huge framerate drop
    By Shadeve in forum Android Export Module 2.5
    Replies: 42
    Last Post: 3rd January 2015, 04:19 PM
  3. Framerate Drop
    By ChrisBurrows in forum Multimedia Fusion 2 - Technical Support
    Replies: 9
    Last Post: 6th March 2012, 03:37 PM
  4. 4000 backdrops, inevitable drop in framerate?
    By Taofeld in forum Multimedia Fusion 2 - Technical Support
    Replies: 10
    Last Post: 1st April 2009, 01:58 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •