Recently I'm trying to make a little more CPU intensive game.
I'm using 800x600 graphics with 32bit colour depth. In a room I set room music in order to play an .ogg file. From that moment on the music starts, but both during load time, and everytime I change a room, I can hear sound artifacts.
Music is distorted, or the same "piece", some of the song's frames, are repeated.
Somehow something strange happens with sound, and this is not the first time I notice something like this, I played Lost in the nightmare, another game made using AGS that uses extensively ambient music and even with 320x200 as a res. I get such artifacts sometimes.
I thought it was due to the fading routines taking so long, and to the engine being single threaded so events polling must be very accurate and timings are critical for music update and a delay would have led to such a result.
But I tried almost every room change transition possible, including INSTANT, and the same thing is repeated. To make sure it wasn't a thing depending on my pc / drivers / config, I tried it on my other 3 PCs at home (one of the is a laptop), they are all high profile PCs with configurations ranging fro 2Ghz to 3Ghz of CPU and with at least 512MB ram and all have different sound cards.
The problem holds on all of the three PCs. I would say it becomes less noticeable (for example shorter cracking time before the music returns stable) growing the specs of the machine.
Of course after some fractions of a second the music goes on normally.
I think this could be due to some wrong polling handling on transitions code, but I repeat , it's the whole change room process maybe.
Anyway I can't affirm anything concrete I'd like to run further tests, but this is how I can go so far.
Take in account as I repeat that this happened to me in 3 different machines, and not only with the game I'm currently making, but with at least another title using mp3/ogg environmental playback.
Thank you for your attention,
Crash.
This did used to be a problem with slower PC's, but it shouldn't be nowadays. AGS is single threaded but it does ensure that the sound buffer is filled during fades and room loading ... however it's possible that for large rooms (eg 800x600x32) it's not doing so often enough, so I'll look into it.