How not to mess up sound effects for flash?

Shayaan

  • Posts: 88
I want to ask how do Stencylers who develop games for flash deal with that short delay before every sound effect (mp3)?

I mean, if you're making a shooter game then the sound for every gun fired will play ~0.3 secs after the gun actually fired a shot. There has to be a lot of Stencylers who develop games for flash. So anybody have a workaround?

Peace 8)

colburt187

  • *
  • Posts: 2249
I have never had a delay in flash using mp3 sfx.

NickamonPoppytail

  • *
  • Posts: 1022
What are you making/editing your sound effects on?
046 121 116 105 116 110 101 100 105 032 121 109 032 116 117 111 098 097 032 110 111 105 116 115 101 117 113 032 111 110 032 101 118 097 104 032 100 108 117 111 104 115 032 117 111 089 032 046 084 074 032 101 114 097 032 115 108 097 105 116 105 110 105 032 121 077 032 046 117 111 121 032 107 099 097 116 116 097 032 108 108 105 116 115 032 108 108 105 119 032 073 032 100 110 065 032 046 116 114 105 104 115 032 115 105 104 116 032 103 110 105 114 097 101 119 032 108 108 105 116 115 032 109 097 032 073 032 046 110 111 115 032 115 105 104 032 109 097 032 073 032 046 101 109 032 119 111 110 107 032 121 097 109 032 117 111 089

Shayaan

  • Posts: 88
Colburt187 you don't get that delay? I get that every single time I convert wav files to mp3 to use in my flash game.

Check this thread out - http://community.stencyl.com/index.php/topic,13212.0.html (in particular the reply of BMJ)

I use Audacity most of the time, but I've tried online convertors too.

It happens to me every single time. That's the reason why my shooter game Digibots have that delay when shooting. It looks bad.

colburt187

  • *
  • Posts: 2249
Do you hear it in this game? https://www.newgrounds.com/portal/view/707846
Although I can’t think of the last time I converted a sound from wav, I think I normally download mp3s directly

Shayaan

  • Posts: 88
Actually the delay doesn't come when you convert the sound to mp3 - the problem is in mp3 format itself. It just adds a gap before every sound because of some technical reasons.

I did some research about this on the Internet, and people say it's not impossible (but hard!) to avoid that gap. And If you check that thread I mentioned above and read the reply of BMJ, he says that using something called LAME encoder (or decoder) for Audacity will make this gap so small that it would be unnoticeable. I asked him but I think he hasn't been online since then.

I just played Worlds at War. And the 0.3 sec gap is noticeable when the projectile hits the planet. And when the projectile is shot from the spaceship (if you pay close attention). I'm working on a fast paced shooter, so 0.3sec is a lot for me!

NickamonPoppytail

  • *
  • Posts: 1022
Actually the delay doesn't come when you convert the sound to mp3 - the problem is in mp3 format itself. It just adds a gap before every sound because of some technical reasons.

I did some research about this on the Internet, and people say it's not impossible (but hard!) to avoid that gap. And If you check that thread I mentioned above and read the reply of BMJ, he says that using something called LAME encoder (or decoder) for Audacity will make this gap so small that it would be unnoticeable. I asked him but I think he hasn't been online since then.

I just played Worlds at War. And the 0.3 sec gap is noticeable when the projectile hits the planet. And when the projectile is shot from the spaceship (if you pay close attention). I'm working on a fast paced shooter, so 0.3sec is a lot for me!

Before you used Audacity, did you have the sound effect on any other file type? If so, does this problem come up if you use this website? This has never happened to me personally and have used this to listen to songs from the Pixeltail soundtrack over and over again to ever so slowly drive myself insane. Hopefully the websites won't give you this 0.3 second delay.

Hope this helps! :)
046 121 116 105 116 110 101 100 105 032 121 109 032 116 117 111 098 097 032 110 111 105 116 115 101 117 113 032 111 110 032 101 118 097 104 032 100 108 117 111 104 115 032 117 111 089 032 046 084 074 032 101 114 097 032 115 108 097 105 116 105 110 105 032 121 077 032 046 117 111 121 032 107 099 097 116 116 097 032 108 108 105 116 115 032 108 108 105 119 032 073 032 100 110 065 032 046 116 114 105 104 115 032 115 105 104 116 032 103 110 105 114 097 101 119 032 108 108 105 116 115 032 109 097 032 073 032 046 110 111 115 032 115 105 104 032 109 097 032 073 032 046 101 109 032 119 111 110 107 032 121 097 109 032 117 111 089

Shayaan

  • Posts: 88
It's getting weird now! When I play my game on flash (browser), the first click plays the sound right away - with no delay, at least 90% of the time. But from the second click onwards, it plays after about 0.3-0.4 secs.

But then I converted that same mp3 that was having that delay to the ogg format (on website that you mentioned above), and I played on the linux platform using that ogg, and the delay was gone!

So I guess there's a problem with the flash player? Because when I convert that same mp3 to ogg to play on linux it works good. Or something else?



Can you play Digibots ( http://www.stencyl.com/game/play/38291 ) and give me feedback on the sounds?

colburt187

  • *
  • Posts: 2249
When I play the Digibots game you linked above the sfx happens instantly, i can't detect a delay at all, but the bullets appear like almost a full second after the button press?

Shayaan

  • Posts: 88
Let me explain what happened.

Originally in my game, the bullets would fire instantly as you click the left mouse button. But about 2 months prior to the release, I found that the sound was playing 0.4 secs after the bullets shot.

Then I got a anew idea to fix this - the sound would "play" as soon as you click, and a preloader kind of thing would appear on the crosshair. When that preloader is fully charged (at 0.4 secs), the bullets would come out AND because the sound was made to play 0.4 secs earlier (at the mouse click), it would appear to be played at the same time bullets are shot because of the delay.


Now the question for you is, does the sound play at the same time mouse is clicked or 0.4 secs after the mouse click when the bullets actually come out?

yogyog

  • Posts: 16
I'm having a similar problem... but not on my fast gaming machine, only on slower, older computers.  There doesn't seem to be any slowdown EXCEPT on the sound effects.

Shayaan

  • Posts: 88
Hey yogyog, can you please try my game on your fast computer if possible? Because my computer is pretty old and I want to know how my game sounds play on newer, faster ones.

Can you please tell me if the shooting sound plays 1) Right away as you click the mouse or 2) a fraction of second after you click the mouse (at the same time the bullets come out)?