Converting .wav to .mp3 without a delay

Krimm

  • *
  • Posts: 111
This is probably a fairly obscure question, but does anyone know of a way to convert a wav file into an mp3 file without having the converted mp3 file have a delay in the front of it? I included a picture for reference, but for whatever reason, whenever I convert a wav to mp3, it adds this short, quarter second delay to the mp3 file. This means that the sound effect for the jump, for example, is off by a bit, and doesn't play until the character is already in the air.

So, my question is if there are any work arounds? Is there any way at all to import wav files into Stencyl? Is there a way to convert a wav to mp3 without a delay being created? (I've used everything from iTunes to audio editors to try and do this, but they all created that delay in the middle). Or is there some way to have the file automatically skip that delay in Stencyl through code blocks?

Is this an issue anyone else has had? I can't seem to find any other people talking about it, and it's quite irritating! Any help at all would be fantastically helpful!


Krimm

  • *
  • Posts: 111
It's still making a small intro break, but that seems to have worked well enough. That's quite a work around! Thank you for the help!

koozek

  • Posts: 9
Hey, I would love to know the solution too :) Would you be so kind an reupload your pdf, Leaufai? Thank you very much!

iggyvolz

  • Posts: 40
You can always crop out the blank space in Audacity.
iggyvolz - Co-developer of Fightmon the Game: Pluff
An awesome new base-building game coming soon!  See our site for details!

Shayaan

  • Posts: 88
Yes you can crop it out in Audacity, but when exporting to mp3 it still adds about a quarter second delay.

Anybody knows how to solve this problem? Or is there a way to use .wav sounds for flash games?

JeffreyDriver

  • Posts: 2262
Yes you can crop it out in Audacity, but when exporting to mp3 it still adds about a quarter second delay.

Anybody knows how to solve this problem? Or is there a way to use .wav sounds for flash games?

I use this https://online-audio-converter.com/ to convert my files.

NickamonPoppytail

  • *
  • Posts: 1141
This is the website I use for audio conversions. The link is to a convert to .mp3 page. Does this delay appear if you try with this website?

https://audio.online-convert.com/convert-to-mp3
Upcoming Projects
Poppytail 5 and Pixeltail: Fifth and sixth main instalments in Poppytail series. A Game About Trimming Hedges: Final Version: An updated version of the original AGATH. One Million: Last-one-standing style small project. The Poppytales: Platformer boss rush with character collecting. Skies n' Fall: Boss rush shooter prequel to Rise n' Brawl. Precious: Weird platformer. Christmas Time 2: Sequel to Christmas Time 1.

Vaibhav Sangwan

  • Posts: 161
Nah, I gave it a try, but for me it gave no benefit.
Currently working on:-
http://www.stencyl.com/game/play/42376
Feedback will be really appreciated

Shayaan

  • Posts: 88
NickamonPoppytail, JeffreyDriver, do you guys have that delay in mp3 sounds when making flash games? Because I've checked online and in Audacity too. This is a problem in mp3 format I think.

It looks really bad when a sound is to be played on clicking the mouse or pressing a key. It looks as if the game is lagging. The sound plays after 0.4 seconds.

BMJ

  • Posts: 278
There are two delays - both unavoidable, but can be minimized to be imperceptible. One is in the waveform itself. Does your waveform show an empty gap at the beginning (usually between .05 and .1 secs)? In addition to this delay, there is also a second delay that is in the file, but not the waveform -- this is the codec information and is also unavoidable, but can be minimized by using the LAME mp3 encoder to convert (this encoder is included in the most recent builds of Audicity, I believe). The good news is that both of these can be minimized to the point where they are not important.

I just did a test -- I converted a WAV file (16-bit signed PCM) with no gap at all to an MP3 (128 kbps, constant bitrate, joint stereo, no metadata) in Audacity 2.1.1 (using the LAME mp3 encoder included with recent Audacity downloads). The result was a delay of .04 secs in the waveform itself. This is small enough to be completely trivial. I then made a flash game in Stencyl and had the sound play on a keystroke (up arrow). The result was close enough to be perceived as "immediate". I've included the game as an attachment.

Note: the very first time the sound is played, there is still a small delay - maybe about .15 or so. I think this is unavoidable, but it's only the first time. After this, the playback of the sound effect is "immediate".

Up arrow plays the sound in the sample game.

Also: if you ever need to seamlessly loop an mp3 (music, for example), the key is to use two separate channels that alternate playing the track at time intervals that create the illusion of one seamless loop.

Also also: fortunately, Flash is on its way out of relevance (and with it the need for MP3 sound resources in games) and is being replaced by html5, which uses OGG format for sound, superior in both quality and without the delays.

« Last Edit: February 22, 2018, 08:43:38 am by BMJ »

Shayaan

  • Posts: 88
I have Audacity 2.1.0 in Ubuntu 12.04. I was able to export to mp3 (with 0.4 sec silence at the beginning) without installing anything extra. So I guess it's built in?

Anyways to check it, I saw video on Youtube saying to go at Edit > Preferences > Libraries, but my Audacity don't have the option 'Libraries'.

I exported my older mp3 file to a new mp3 file with 128 kbps, constant bitrate, joint stereo, no metadata, but still it has the silence at the beginning.

Any idea? How do I check if LAME is built-in?

Vaibhav Sangwan

  • Posts: 161
It is not installed but you don't have to install LAME encoder in ubuntu.
Currently working on:-
http://www.stencyl.com/game/play/42376
Feedback will be really appreciated

Shayaan

  • Posts: 88
So what do you mean? That it can't be installed on Ubuntu?

Vaibhav Sangwan

  • Posts: 161
No,I mean it is not required in ubuntu.
See these:-
https://www.audacityteam.org/download/linux/
there is no optional download reqired in this.

but for windows:-
https://www.audacityteam.org/download/windows/
Currently working on:-
http://www.stencyl.com/game/play/42376
Feedback will be really appreciated