Ambient Sound format problem

Started by Aquilo, Fri 24/02/2006 00:44:05

Previous topic - Next topic

Aquilo

I came across a certain problem adjusting the room ambient sounds. Normally the PlayAmbientSound function is to be used, and it runs nicely - BUT only as long as the sound itself is pure generic WAV (AGS doesn't seem to understand ADPCM compression or ACM-compressed WAVs). A need often arises for seamlessly looping sound, as water streaming effects and such. When the original WAV is converted either in OGG or MP3 to reduce its size, at the beginning of every new sound loop there suddenly appears a distinct pause or even a nasty click which ruins the seamless fluence of the looping. And it makes no difference what codec or software is used for conversion, so the problem must lie within the format itself. Is there any way to solve this or work it around? A game with uncompressed sound would weight tons, and a constantly clicking or stuttering ambience sounds lame :-[

RickJ

The problem may be in your conversion.   Have you tired editing the MP3 with a sound editor such as Audacity, which is free, or others?

Adamski

I'm using OGGs for music and ambient loops, and they're completely seamless. There is an inherent flaw with the MP3 format that causes bad looping due to encoding/decoding inconsistencies or something, so make sure you don't accidently have everything secretly encoded as MP3s ;)

Aquilo

Thanks for replies. Yes, i have, namely, 'tired' ;) to decode the converted files to edit and try to find the problem source, trying every possible option while encoding - changing bitrates, encoding modes and such. I'll try Audacity (currently using Adobe Audition, Steinberg Nuendo and Sound Forge), perhaps it'll show more. And yes, OGG is far better than MP3 in every aspect. As far as I was able to determine, mp3 causes problems also because of the ID tag present in every file, even if every field of the tag is left empty - some decoders stop end rewind the sound at the very end of the file, which include the ID, and these milliticks of 'empty' bytes cause the click, which seems to be the case with the AGS engine. A question to Adamski, the lucky one :) : which AGS version is used and what namely is the program that your OGGs are created with? For I have tried many encoders, but the problem still persists. The new AGS 2.72 beta 4a seems to handle the sound somewhat better than previous releases, but doesn't eliminate my problem completely. Maybe I'll just use your software combination, if you reveal what it is ::)

Adamski

#4
I've been using just plain old oggdrop for my recent project, working in AGS 2.71, and both PlayAmbientSound and PlayMusic are seamless in regards to looping. I've never had a problem with OGGs looping at all, not in the Byzantine demo (looping music, some spot effects here and there) and more recently in Ben Jordan Case 4, and I used Soundforge in both those occasions to encode. I haven't used any specific bitrate either, BJ4 uses a multitude of different encoding settings.

Very weird indeed.

Edit: Just some numbers and stastics, BJ4 was made in AGS 2.62, and Byzantine demo was made all the way back with a 2.4 version... I think.

Aquilo

I've just downloaded Audacity and an 'old' version of Oggdrop. The output of either of the two eliminates my really weird problem at last ;D it seems that AGS' free OGG decoder isn't updated as often as AGS itself, having issues with OGGs encoded with the very latest encoder versions of this format. So I consider the problem solved, having just now recoded tested everything I had trouble with. Thanks for help everyone!

Adamski

Well, I'm using the latest version of the encoder and I've just tried a couple of tests without any glitches, so I'm still not convinced it's a problem with AGS ;) I'll see if CJ is able to look into it anyhow, there might be something unusual going on under the bonnet.

Pumaman

Well, AGS just uses a third-party OGG player, and I must admit I don't understand the algorithms involved well enough to look into this with any sort of competance ;)

Glad to hear you've got it working, anyway.

Aquilo

Well, that is just what I had in mind saying this - the AGS main core is one thing, and mp3/ogg decoders, though being part of it, are something stand-alone and independent (being third-party, that is). One way or other, it worked - there are just too many variations within seemingly rigid and consistent formats, and finding the 'good' software combination where every part fits with another often solves the problem, though finding out such a successful combination may be a problem by itself ;) Thanks for all the effort and pains, Chris!

SMF spam blocked by CleanTalk