Adventure Game Studio

AGS Support => Advanced Technical Forum => Topic started by: nightmarer on Wed 06/01/2021 20:02:48

Title: Audio: loop gap from the end to the beginning.
Post by: nightmarer on Wed 06/01/2021 20:02:48
Good evening all.

I realized that the ambiance loops leave a gap before they start again that lasts a little less than a second.
I know it is not too much, but it is fair enought to be noticed, especially if the game is playing a noisy ambience, as the sound of the rain.
I tested that the loop is correct if I execute it outside of AGS.
Does anybody experienced this issue? Is there any way to fix it?

Regards.
Title: Re: Audio: loop gap from the end to the beginning.
Post by: Laura Hunt on Wed 06/01/2021 22:16:00
If you want to create seamless loops in AGS, you need to use ogg or wav. Converting to mp3 always leaves a silent "gap" (this is an issue in the format itself, not in AGS), so in very simple terms, mp3s can only be looped seamlessly if the application you're using "knows" this and can compensate for it by removing that gap in real time. Most mp3 players and audio editing apps do this, which is why you don't hear the gap when you play your loop outside of AGS.

Title: Re: Audio: loop gap from the end to the beginning.
Post by: nightmarer on Thu 07/01/2021 08:43:08
Hello, thanks for your answer.

it is ok to convert the sounds to ogg, or I need to export the audio again?

Regards.
Title: Re: Audio: loop gap from the end to the beginning.
Post by: Laura Hunt on Thu 07/01/2021 10:28:46
If you convert your mp3 directly to ogg, then the gap will still be there, of course (not to mention that the two-step compression would result in further loss of quality). You would need to export the audio directly to ogg if your audio editing software/DAW allows for it, or export to wav and then convert from that to ogg.
Title: Re: Audio: loop gap from the end to the beginning (SOLVED)
Post by: nightmarer on Thu 07/01/2021 14:41:15
Ok, thank you very much for the information
Title: Re: Audio: loop gap from the end to the beginning.
Post by: nightmarer on Thu 11/02/2021 16:43:14
BTW to who may concern. An OGA file is an OGG file. If anyone has an OGA file he can just change oga to ogg extension and it works perfect in AGS.

Regards.
Title: Re: Audio: loop gap from the end to the beginning.
Post by: Crimson Wizard on Thu 11/02/2021 17:16:53
Quote from: nightmarer on Thu 11/02/2021 16:43:14
BTW to who may concern. An OGA file is an OGG file. If anyone has an OGA file he can just change oga to ogg extension and it works perfect in AGS.

That depends, as I found out recently, AGS can only reliably play files encoded with OGG Vorbis codec, but fails at some others. For example it failed playing OGA file encoded with FLAC codec. I've tested one from this page: https://filesamples.com/formats/oga and it did not work.