Yes, I realised I've asked this before, but it was one part of a double question and never really got discussed much.
I can't be the only one who uses loops on their audio tracks so I'm putting this out to anyone who's discovered a way to mask the little 'pop' noise you hear when the sound clip ends, then starts its next loop.
I use Audacity to create my sound files and did try fading out the clip, but this only accentuates the split.
Any ideas appreciated.
Comments
I understand issue B, but even if I took the time to do this I don't see how it would eliminate the gap.
I very much suspect there's nothing can be done, as what I'm hearing is that split-second, unavoidable moment of silence as the track stops then starts up again.
As a self-help project, you may be able to use Howler.js in Web Audio API mode, not HTML5 media element mode, to resolve the issue if it's really important to you—completely untested.
That would come with its own issues though. Notably, all such audio has to be completely loaded before use and must stay loaded for the lifetime of its use. It's also much more strict about cross-origin resource sharing (CORS) issues.
Claretta, the only reason I keep tracks short is because I've not yet investigated max file size for games. The last thing I want is to end up with a game that's too big (file size wise) because it's littered with big audio files.
I only really have two ambient tracks that are designed to play on a loop long term. That is a general 'outside' noise (wind basically) and a rain track for periods I want it to be raining.
I understand what you're saying - that an ambience which 'pops' at the loop every two minutes is going to be far less noticeable than one that pops every 15 seconds, but can I safely include tracks that long without compromising file size?
But to do it, yes you do need longer tracks (at least a minute). a 1 minute ogg at 0.5 quality is about a megabyte, which should be ok.
If you don't have heaps of audio, I don't think you should worry so much about file sizes. YouTube videos are waaaaay bigger than a few MB, and people stream those all the time. We don't need to design for dial up.
However, my audio file sizes come in at an average of 50-60kb, so good to know I have room for at least a couple of a decent length.
greyelf, do you mean a way to mute all sounds, or just the ambience? I haven't included such an option and wouldn't know how, so I'll have to look it up.
Would it be as simple as adding: in the sidebar?
[EDIT] Yes it would. That was simpler than I feared.
I assume muting master is done in the same way, but if you could advise on the toggle method that would be appreciated.
Real wind and raid sounds fade in and out. Wind and rain isn't constant. If it's really well done, ambient noise which fades in and out shouldn't be annoying.
I don't think muting controls are truly necessary in all games, though. It really depends on the game.
I dunno, you might be right, it's just my hope that my sounds won't even be noticed after a while. They're not loud or intrusive and in any case they now have the option to disable them if they do get annoying.
I agree that if the track was as long as 5 minutes, a fade out / fade in would probably be the best option.