User Tag List

Results 1 to 9 of 9

Thread: sound lagging

  1. #1
    No Products Registered

    Join Date
    Aug 2006
    Posts
    19
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    sound lagging

    It's a simple situation, but I can find no way to code it.

    In my game (MMF II dev, 243) your guy is on a motorcycle. The rumble of the motorcycle loops.

    When you hold the right arrow pressed, the motorcycle speeds up. I also want the sound to speed up, 'cause the bike's going faster.

    This has given me the devil of a time.

    I can manage to code it so that it does what I want: when the right arrow key is held down, the rumble gets higher. There are two ways to do this: you can either re-record the audio sample at a higher frequency, or have MMF kick up the frequency for you.

    It works well and I'm proud of it. When you stop pressing the right arrow key, the sample goes back down to normal, and so does the speed of the bike.

    There's just one thing that's bothering me.

    Whenever you code in "play this sample whenever this key is held down," MMF takes a slight delay before playing the sample -- no matter how you code it.

    In other words, the bike goes faster for about a second before the "faster" sound kicks in.

    It's strange, but there is no delay going the other way: when you go from fast back to normal, the normal sound kicks in immediately.

    The one-second lag makes the game feel all wrong.

    Yet I can't understand it. MMF suffers no analogous delay if you are changing an animation or creating an object.

    Only if you hold a key down to play a sample.

    So I guess my question is: is there a way to code this? Can I somehow lodge a sample in the "running memory" so it's always ready to go? I've coded this motorcycle thing about five different ways, but all with the same result.

    Thanks to any who help.

  2. #2
    Clickteam Clickteam
    Jeff's Avatar
    Join Date
    Jun 2006
    Location
    Battle Ground Washington
    Posts
    11,825
    Mentioned
    8 Post(s)
    Tagged
    2 Thread(s)

    Re: sound lagging

    Any chance you could upload an example file of the problem?

  3. #3
    No Products Registered

    Join Date
    Aug 2006
    Posts
    19
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: sound lagging

    Done and done.

  4. #4
    No Products Registered

    Join Date
    Jul 2006
    Posts
    375
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: sound lagging

    Hope they find a solution for this, I was wrestling with this one awhile back with a car game I was working on... I'd LOVE to see the fix for the delay!

    One thing, perhaps when you are holding that key down it is playing it a million gazillion times? (mine had the "DO once per..." tossed in there)



  5. #5
    Forum Moderator Fusion 2.5 DeveloperHTML5 Export ModuleiOS Export ModuleSWF Export Module
    DavidN's Avatar
    Join Date
    Jun 2006
    Location
    Boston, MA, USA
    Posts
    4,044
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: sound lagging

    It's because you have an "Every 00-62" condition in the event that raises the frequency of the sound, making the event only trigger when the timer is a multiple of that value. I'm not sure what it was doing there.

  6. #6
    No Products Registered

    Join Date
    Aug 2006
    Posts
    19
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: sound lagging

    The reason the every .62 condition is in there is because otherwise it would play the same "a million gazillion times," as TDA says, and you can't work your way around it with the "if the sample is not playing" command.

  7. #7
    No Products Registered

    Join Date
    Aug 2006
    Posts
    19
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: sound lagging

    62" being the length of the slow sample.

  8. #8
    Forum Moderator Fusion 2.5 DeveloperHTML5 Export ModuleiOS Export ModuleSWF Export Module
    DavidN's Avatar
    Join Date
    Jun 2006
    Location
    Boston, MA, USA
    Posts
    4,044
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: sound lagging

    Right, I see. You're better off using "Restrict actions for 00-62" in that case.

  9. #9
    No Products Registered

    Join Date
    Aug 2006
    Posts
    19
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: sound lagging

    Gadzooks, DavidN. You fixed it!

    I guess that "62 must have been vestigial -- left over from a previous failed approach.

    Gracias.

Similar Threads

  1. Lagging App!
    By XStar in forum iOS Export Module Version 2.0
    Replies: 17
    Last Post: 15th September 2012, 02:05 PM
  2. Score Lagging
    By Kracker in forum Multimedia Fusion 2 - Technical Support
    Replies: 0
    Last Post: 16th January 2010, 02:36 AM
  3. HWA : Game lagging because of Layer effects
    By Dynamite in forum Hardware Accelerated Runtime
    Replies: 8
    Last Post: 11th January 2009, 03:07 PM
  4. MOO and lagging
    By kornelijepetak in forum Multimedia Fusion 2 - Technical Support
    Replies: 10
    Last Post: 30th November 2007, 06:33 AM
  5. BUG: Objects Lagging Behind Mouse
    By LazyCoder in forum Multimedia Fusion 2 - Technical Support
    Replies: 4
    Last Post: 22nd October 2006, 07:24 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
  •