Page 1 of 1

wave header corruption in combat

Posted: Mon Jul 27, 2020 3:45 pm
by zach_holbrook
Nothing game-breaking (I think), but I've noticed that wave files play inconsistently in combat. Whenever they don't play, I get this error in the log:

7/27/2020 11:36:44 AM: System.InvalidOperationException: The wave header is corrupt.
at System.Media.SoundPlayer.ValidateSoundData(Byte[] data)
at System.Media.SoundPlayer.LoadAndPlay(Int32 flags)
at IceBlink2.GameView.PlaySound(String filenameNoExtension)

At first I thought there were some corrupt files or files that were in the Sounds folder with an unreadable bit rate, but the files still played with no error at other times, and I even re-imported the raw sound data into Audacity, exported as a new WAV with a standard bit rate, and still got the same error -- I wonder if it's timing related? Combat is moving quickly, so perhaps one sound starts before another has finished, and this gives the engine some difficulties?

Re: wave header corruption in combat

Posted: Mon Jul 27, 2020 8:48 pm
by slowdive
I think you are right and it is timing related. It is tricky trying to understand how the various audio tools work from a coding stand point (especially for us self taught coders :lol:). Karl has been very busy with the move to a new place. Sound is a somewhat threaded activity so it can be inconsistent in how it “plays” out. 😂

Re: wave header corruption in combat

Posted: Mon Jul 27, 2020 10:23 pm
by zach_holbrook
Cool cool, I'm more curious than anything. It's definitely not a major issue and doesn't seem to make anything unstable. I've been in the weeds with audio stuff lately -- trying to get all the tracks for Malkin to sound like they're part of the same world and balancing the sfx/music volumes -- so I thought I'd ask!

Re: wave header corruption in combat

Posted: Tue Dec 22, 2020 4:05 pm
by youngneil1
Thank you for the bug reports, Zach - they will not be lost and hopefully not in vain. Sound is a field that needs more fleshing out for sure in the long run.