|
Posted by NRen2k5 on 11/17/17 11:48
Chris Tomlinson wrote:
> Hi all, I wish to play a looping MP3 'sound effect' of a street on a new web
> page I'm working on. The idea is that the sound will seamlessly loop and
> give the impression of constant background noise so you feel like you're
> there.
>
> However, due to the nature of MP3s they contain a short gap of a few ms at
> the start and end of the file. This is due to the way the frames have to
> always end.
Yes, and as such I would think that the gap at the end of the file is
the only one we need to worry about. The gap (an offset, actually) at
the beginning ought to be negligible.
> I started with a wav with no gaps, and have used Wimpy Converter to convert
> it to a SWF-safe MP3.
So far so good.
> I am then using Wimpy Button to try to loop the sound, but I still get the
> gap. It is actually there in the converted MP3 file.
Yep.
> I have tried removing the gap, but it comes back. I have tried other
> converters, and Sound Forge, but still the same.
The reason why programs like SoundForge are incapable of getting rid of
the gap is because they are not actually editing the MP3 file as-is, but
are actually decoding it to WAV in secret and then encoding back to MP3
again - hence the gap comes back.
Try using MP3Trim (http://www.mptrim.com/) to trim the last frame off of
the MP3.
> Basically, is there a way to play a looped compressed audio file (needn't be
> MP3) in a web browser, that is compatible with IE and FF (needn't be SWF)?
Trimming the last frame off of the MP3 with MP3Trim is probably your
best bet. Using any other format would run the risk of making the sound
not play for some people, requiring them to download some sort of
plug-in for their browser. ADPCM is probably the next best option if you
can't get the MP3 to work the way you want it to. ADPCM won't compress
nearly as well as MP3, but at least it will still be smaller than an
uncompressed sound.
- NRen2k5
[Back to original message]
|