How not to mess up sound effects for flash?

Shayaan

  • Posts: 85
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: 2223
I have never had a delay in flash using mp3 sfx.

NickamonPoppytail

  • Posts: 911
What are you making/editing your sound effects on?
Currently developing Poppytail 5, Pixeltail and The Poppytales.

Email: nick.rosemarygames.poppytail@gmail.com

;)

Shayaan

  • Posts: 85
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: 2223
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: 85
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: 911
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! :)
Currently developing Poppytail 5, Pixeltail and The Poppytales.

Email: nick.rosemarygames.poppytail@gmail.com

;)

Shayaan

  • Posts: 85
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: 2223
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: 85
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: 15
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: 85
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)?