[Not a bug] Gap on looping MP3s

Things in RTC that do not work as expected (compared to Dungeon Master) or at all! Please read previous posts carefully to see if the bug has already been reported.

Moderator: George Gilbert

Forum rules
Please read the Forum rules and policies before posting.
Post Reply
User avatar
Gambit37
Should eat more pies
Posts: 13720
Joined: Wed May 31, 2000 1:57 pm
Location: Location, Location
Contact:

[Not a bug] Gap on looping MP3s

Post by Gambit37 »

If you use a MP3 as a looping ambient sound, there is a noticeable silent pause between each loop. This doesn't happen with PCM WAV.

I imagine this is due to continually decompressing the sound or something? Can it be fixed?

EDIT: I opened my MP3 to view it and some empty space has been added to the start and end! If I remove this and resave as MP3, it comes back!

Anyone know how to avoid this?
User avatar
Gambit37
Should eat more pies
Posts: 13720
Joined: Wed May 31, 2000 1:57 pm
Location: Location, Location
Contact:

Post by Gambit37 »

Seems as if OGG doesn't have this problem! Guess I'll stick with that -- it's files are smaller too!
User avatar
Sophia
Concise and Honest
Posts: 4240
Joined: Thu Sep 12, 2002 9:50 pm
Location: Nowhere in particular
Contact:

Post by Sophia »

You can't avoid it. It's an artifact of the MP3 encoding process.
User avatar
beowuuf
Archmastiff
Posts: 20687
Joined: Sat Sep 16, 2000 2:00 pm
Location: Basingstoke, UK

Post by beowuuf »

yup, always annoying on listening to albums where the songs are supposed to be a continuous flow
User avatar
Gambit37
Should eat more pies
Posts: 13720
Joined: Wed May 31, 2000 1:57 pm
Location: Location, Location
Contact:

Post by Gambit37 »

Guess I've never noticed it using Windows Media Player as it has intelligent read-ahead buffering.

I noticed this on iTunes though and simply thought the software sucked. Guess it was the files themselves afterall.
User avatar
Des
Um Master
Posts: 461
Joined: Wed Jun 11, 2003 11:58 pm
Location: Southampton, UK

Post by Des »

I've just been playing with this and even using a WAV I get a "blip" between each repetition. I was hoping to create a seamless continuous sound using just a short sound clip.

This is the one I used (made with Nero Wave Editor) Takk Snippet - about a second of Sigur Ros.

I was wondering if it's not possible to get a totally seamless loop or if my file actually has a very short period of silence. I guess maybe the answer is to use a longer snippet with a fade-in and fade-out?
User avatar
Gambit37
Should eat more pies
Posts: 13720
Joined: Wed May 31, 2000 1:57 pm
Location: Location, Location
Contact:

Post by Gambit37 »

The looping works for me -- you probably have a small gap of silence at the end beginning. Should be easily spottable in any decent sound editor.
User avatar
George Gilbert
Dungeon Master
Posts: 3022
Joined: Mon Sep 25, 2000 11:04 am
Location: London, England
Contact:

Post by George Gilbert »

For looped sounds, RTC detects that it's stopped once per frame (so about every 1/60th of a second) and restarts it if necessary. If something complex is happening in the dungeon, then I guess it could take up to 1/10th of a second to detect the loop.

I would have thought that that was a short enough gap to be inaudible. If you have a very short sample (much less than a second) however, I could just about believe that the rapid on / off of the sound could be audible.

As Gambit suggests, it's probably the sound itself that has a gap at the start / end. As you suggest, you could always just have a longer sample and fade loop sounds at the start and end so that if there's a tiny silence then it won't be noticed. Realistically though, that shouldn't be needed.
Post Reply