wave header corruption in combat

Discuss IB/IBx engine ideas, bugs, etc.
Post Reply
zach_holbrook
Posts: 94
Joined: Thu Jan 16, 2020 5:00 am

wave header corruption in combat

Post 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?
User avatar
slowdive
Site Admin
Posts: 509
Joined: Wed Jan 15, 2020 4:37 am

Re: wave header corruption in combat

Post 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. 😂
zach_holbrook
Posts: 94
Joined: Thu Jan 16, 2020 5:00 am

Re: wave header corruption in combat

Post 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!
youngneil1
Posts: 148
Joined: Mon Jan 20, 2020 9:01 am

Re: wave header corruption in combat

Post 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.
Post Reply