🎉 Celebrating 25 Years of GameDev.net! 🎉

Not many can claim 25 years on the Internet! Join us in celebrating this milestone. Learn more about our history, and thank you for being a part of our community!

What sound format should I use for sound effects for my MS-DOS game?

Started by
22 comments, last by yaboiryan 3 years ago

Back in the DOS days, many games used 3rd party sound libraries (not SDL) specifically because each sound card required a different interface (especially for music [as opposed to SFX] ).
I suggest you select your sound file format based on the library you want to use.

If you want to code your own (which will require alot of effort) , then I suggest you target a single mainstream card (like sound-blaster), and code your own. Then create a convertor which will convert a popular format into your old DOS format. I did this for my DOS games for 3D models: Model in 3D studio -→ export to my custom DOS optimized model format. I would follow the same workflow for sound. However take into consideration, that rolling your own sound “engine” will be very fun, but will possibly be more work than your actual game :-) .

So it really depends on how much time you have, and where you want to spend it. Coding low level engines is fun! But it will take up time you can spend working on your actual game.

If you simply want to copy ID-Software code, have a look at: https://github.com/id-Software/DOOM/blob/master/sndserv/soundsrv.c

My Oculus Rift Game: RaiderV

My Android VR games: Time-Rider& Dozer Driver

My browser game: Vitrage - A game of stained glass

My android games : Enemies of the Crown & Killer Bees

Advertisement

@SillyCow Where might I find these audio formats, and where might I also find these libraries that can implement these sound formats?

@undefined I have already programmed a (mostly) working 3D FPS Game Engine in C with DOS. I dont really want to convert the ENTIRE project into Windows at the moment.

22050 hz mono wav for sound effects, mid for music. should be compatible, and should give good results.

@Geri Okay so now I just created a new library made from some copied functions from Varmint (which is a sound library for Watcom) and I am trying to use it now, but only a few of the sounds actually work, and setting the Bit Resoution to 22050 and mono makes the sound play even less correct than it was already playing.

Oh, and quick update, I got the .wav files from this link to work just fine, but I cant figure out what the wav files in this link have that the ones I am making dont have…

@sillycow I found a sound library that is freeware and I started building on that, and I got some .wav files to work. Specifically the ones that came with the library in the demo folder and the ones that come from the link I mentioned in the post above (here). THe other ones sound incredibly weird and distorted, so I went and tested them with the normal game library from which I had based my own game functions and I got the same result. So I then went and tested it with another DOS sound library demo and that one gave me the same distortion issue.

However, when I tried a sound player called “Plany.exe," the sound worked flawlessly without any type of errors or sound distortion, which gives me hope, but at the same time, I honestly don't know enough about .wav files to know what went wrong.

If it were me, I would just reverse engineer the file format of the files that you have working well. It would be much easier to find an external program to convert your audio samples into that same file format which you allready have working, then to reengineer the code to play arbitrary formats and bitrates

My Oculus Rift Game: RaiderV

My Android VR games: Time-Rider& Dozer Driver

My browser game: Vitrage - A game of stained glass

My android games : Enemies of the Crown & Killer Bees

@SillyCow Thats the issue. I dont have one that works well enough to use other .MOD files, and that is only for music.

probably the wav files you used was stored with some non-standard strides, or used a non-standard word type. just re-save them with windows sound recorder in win98 or something, it should work. please note that randomly downloading code snippets for 30 year old sound apis and combining them with wave files recorded with phones made two months ago is not going to magically work, no matter how hard you google it.

@Geri and @silly cow I tried that yesterday, and that still did not work. So I ditched implementing .WAV files, although they can still be implemented if I want, but I stopped using them. I am not testing out .VOC files. I am using an earlier and open source version of the Miles Sound System (the game engine Empire Earth used). I am now having another issue. Only half of the file plays correctly (which is an upgrade from the .wav file that would not really play at all). And the good part about this is that with each .VOC file I have tried, I have gotten at least half of the file working correctly. Now I need to figure out what is going on with the other half of the file.

This is not only happening in the game itself, but this happens with all of the demo .VOC files that John Miles provided. The demo also plays these strangely when I compile it. But oddly enough, the example demo that John Miles provided plays the .VOC sounds perfectly, which leads me to believe that there is an error in my compilation. I sent an email to Mr. Miles, and I will keep all of you updated about how that is going.

Here are two possible solutions I am thinking about using:

I can edit the file and make it where the bulk of the sound happens in the second half of the file.

I can recompile the .obj file that is provided (which I have not yet successfully done) and then just try it out with that file, although the one that Miles provided in the source does not work.

What do you all think I should do?

Also, this doesn't really have any significance, but I am using SoundBlaster as my sound card.

This topic is closed to new replies.

Advertisement