Fighting some weird sound glitches

Started by kyodai, Mon 02/04/2012 14:40:38

Previous topic - Next topic

kyodai

OK my first fight was with a midi file that i ripped from Space Quest 6. Imported it into AGS and on preview AGS practically crashed (Actually it came up with an error message but you could not get rid of it as the message constantly re-appears, so killing the task was the only way...). Okay i thought maybe its just the preview and played it in a room without fumbling around in the preview - that only resulted in weird glitched glibberish coming from the speakers.


Okay i thought - maybe bad midi. So i fixed the problem using a WAVE file as the music which works actually fine.

Now what I am doing is using room 1 as my intro screen (Also startup screen of my character), added a nice intro GUI to select "New", "load", quit", which works pretty well.

On New i just beam my character to room 2 which works fine.

The weird thing is that as soon as the character starts walking some weird glitched sounds come from my speaker.

I was a bit surprised as i stop the sound upon clicking "new", but i thought maybe its related to the intro sound. As a cross check i edited out the whole intro music but still i get the weird sound as soon as i walk around.


The funny thing is i had no problems while walking around in my original room 1 (Which was just a playground for testing before i made it my intro screen).


I searched a bit for stuff like "AGS sound glitch" "AGS weird sound" and so on, but no usable results so far. Does anyone have a clue what I am doing wrong?

kyodai

#1
Okay i fixed it myself, but it seems this is a little bug in AGS 3.2 i think.

What actually fixed everything was removing the "dead" midi file. Although it is not used in any scripts (I also got no warning as it should appear when you delete an item used by scripts) deleting the midi from my "Music" tree in AGS fixed everything. A bit weird. SO lesson learned: Kids if you have bad midi files then get rid of them or they start haunting you. ;)



If someone is interested in the problem with the midi file - i have uploaded it for reference.


http://www.tankraider.com/userup/1333431433.zip



To reproduce the errors just add it to your "music" tree in AGS and try a preview or play it somewhere in the game.
If anyone knows how to fix this i would still be interested as WAVE files are considerably larger, so not the coolest workaround ever.
Also i would be interested why it affects the game even when the audio is not played or referenced in any scripts, i thought that should not happen.

Khris

AGS supports footstep sounds, i.e. you can assign a sound to a frame in the View Editor and if you set that view as the Character's NormalView, the sound is played every time the frame is displayed while walking.

kyodai

Ah Khris to the rescue! Excellent info as usual. Took me a moment to find the setting, but in my around 60 frames there were indeed 2 of them that included the sound setting. I imported the view so i did not check it much, but now i think the original view was referencing to sound "1" and as the midi was the first sound i imported the midi was obviously sound number 1, so i think that is solved. Thanks so much!!!!!

Why the midi file is not compatible with AGS is till a riddle to me personally. I don't really know much about midis. It plays fine in windows media player, but in AGS it results in a "divide by zero" error on preview and in weird glitched sound when played in game. I have read that there are at least 2 midi types. It seems midi type 0 is some super old standard from stone age and that most more recent midis are probably Type 1, maybe that is the problem? Would be cool if i could use the midis in my game, so i hope there is a way to convert them into some type (well NOT wave, hopefully) that allows usage in AGS. I have seen many AGS games use midi without problems, so hopefully there is a way.

Khris

You could upload the file so we can take a look at it.
What tool did you use to rip it?

kyodai

Ah yeah, here is the midi file:

http://www.tankraider.com/userup/1333431433.zip


Actually all midi files i ripped from Space Quest 6 suffer from that problem. I even tried the Roger Whistling which is just 1 1KB midi, around 15 seconds long and all other files i tried have the same problem as well.

I used SCIViewer to rip these - mainly because it's the only tool that i had luck with using the Sierra VGA games.

I experiemented a bit with the midis, i downloaded converters that convert Midi 0 to Midi 1, i tried to add a copyright comment (Had hoped that this was the "null" problem), i tried midi repair tools, but all without success. The midi files play well in Windows media player and VLC (Have to pick a sound font in VLC first as with all midi files) but they all get AGS to cough on them.

I have tried some random midis i downloaded from the web, like the zelda tune and stuff and these work well in AGS. Its just the ones ripped with SCIViewer that AGS hates.

kyodai

Okay, i managed to "fix" my bad midi files, so i thought i would post a little tutorial here if anyone else has the problem, at least unless that "bug" (???) in AGS gets fixed. I call it "bug" as the midi file plays fine in several players.


OK so here is what i did:

1. Use the command line app "midi2txt" to make a text file out of your bad midi
2. Edit the text file. Pretty much on top you see something like "unit -7681" or so. That cause it to not work. I had to set unit to 30 to have the file being at the correct speed. If your resulting midi is too slow or fast then its this parameter.
3. run txt2midi and BANG you have a midi file that works in AGS




Heres a zip with a "bad" midi file, the tools and output files.



http://www.tankraider.com/userup/1333432003.zip



In the end the "good" and the "bad" midi files just differ a few characters, but what counts is that i now have a midi that plays fine in AGS. Dun ask me what the actual problem is with the "bad" ones, i got NO idea. But this is how you fix it.

Construed

I know what the problem is,

This version of SCIViewer works without problems for exporting sounds:
www.gamersplanet.tk/sv1.zip

This version of SCIViewer works without problems for images:
www.gamersplanet.tk/SCI_Viewer_(sv1).zip

I felt sorry for myself because I had no shoes.
Then I met the man with no feet.

SMF spam blocked by CleanTalk