Adventure Game Studio

AGS Support => Advanced Technical Forum => Topic started by: hedgefield on Fri 22/07/2011 02:31:42

Title: Fonts going haywire when music plays
Post by: hedgefield on Fri 22/07/2011 02:31:42
Hey fellas, reporting on a weird issue I just encountered.

I added a song to a prototype I'm building, and all of a sudden after about a minute of playing the font goes haywire, preceded by a popping noise, like if you'd twist an audio cable while it was plugged in. Whenever that happens, a certain set of letters turns into some sort of garbled mess. It's only those letters, and they change on every playthrough, it's never a recurring set.

(http://timhengeveld.com/fudgedfont.png)

The first few times the game just hung, then I got this error message (http://timhengeveld.com/fudgedfont2.png) about something completely unrelated.

The (ir)relevant code blocks referenced in the error:
player.Narrate("Was the killer looking for something?");
&
function Narrate(this Character*, String txt) {
 //this.SpeechView(0);
 this.SayAt(22, 740, 978, txt);
 //this.SpeechView(0);
}


I think something inside the mp3 is borked because as soon as I comment out the .Play command for it, no more crashes of any kind.

It's not really a problem, I can re-encode the song or pick another one, it doesn't matter, just thought I'd drop this here for smart people to take a gander at in case it's something weird in the engine code - using 3.2.1.111, by the way. 1024x768, 32bit, and all that.
Title: Re: Fonts going haywire when music plays
Post by: ddq on Fri 22/07/2011 02:39:19
Two things: one unrelated, one perhaps maybe sorta vaguely helpful.
1) good god that looks pretty
2) Don't use mp3. Use ogg instead. It's better in every way and switching might even fix your problem, however unlikely.

Now someone who knows what they're taking about please chime in.
Title: Re: Fonts going haywire when music plays
Post by: hedgefield on Fri 22/07/2011 03:10:30
1) Thank you! If all goes well you'll be able to play it next week.
2) I know, I feel dirty when I use mp3's but this was just a throwaway tune that I stuck in there as filler. But in the meantime I did re-encode to OGG and that hasn't given me any grief since, so shoddy mp3 encoding still remains the primary suspect in this case (to stay with the lingo).
Title: Re: Fonts going haywire when music plays
Post by: Peter Bear on Fri 22/07/2011 09:10:46
How can audio interfere with display ?
Title: Re: Fonts going haywire when music plays
Post by: Gilbert on Fri 22/07/2011 10:32:46
If there is some memory corruption or the like caused by the MP3 driver then this is possible. Just wild guess though.
Title: Re: Fonts going haywire when music plays
Post by: monkey0506 on Fri 22/07/2011 11:09:57
I've actually seen a relatively high number of MP3 files become somehow corrupted by apparently nothing more than regular media player usage. The players themselves typically read the file just fine, but if you try to set the metadata or use certain programs like Music Beta by Google then you'll find that there really is something wrong. May not show the exact same symptoms on your system or MP3, but if nothing else, re-encoding the file probably couldn't hurt.