Forum archive
Sound engine problems
- Hi Ken, sorry to bother you again. This time I'm not sure if you can help me. I want to be able to use sounds and sound effects in my engine and I've decided I could use Jim Dose's sound engine, the one made for Rise of the Triad and Duke Nukem 3D if it is OK with him (my engine is freeware). I learned how to use the library. I even made a program to test the midi music routines and it works but when I tried with digitized sound (with wav/voc files) I encountered serios problems. I forgot to say: I own an Intel Pentium III, 128 RAM memory, and a 100% Sound Blaster compatible sound card (it doesn't really mather the type of my sound card because I tried the program at a friend and It has the same problems) and I compiled under Open Watcom with the *obj. files because it wouldn't compile the standard *.h and *.c files.
I don't know if you can help me because I don't know if you had anything to do with Jim Dose's sound engine when you worked for Duke Nukem 3D but here goes nothing: I modified the PS source file (a test program for digitized sound files in the public directory) because it gave me an error that the SB address was not set. So I set the SB settings manually in the code: base address (0x220), IRQ Level (5), Dma Channels 8bit (1), 16 Bit (6) and the number of voices, sample bits and the number of channels (I'm positive about the settings and I tried different configurations for the number of voices,sample bits and channels but it still doesn't work). In Duke Nukem 3D these settings work. After the manually configurations it's error free but after the PlayWAV call the program stucks in a loop or something and never exists to continue with the Shutdown routines.
I can give you the source code if you desire. I emailed Jim Dose to ask him for an advice but he didn't replied.
Can it be because of the different compilers? I understood it was compiled with Watcom v10.0b.
Thank you! I've decided I could use Jim Dose's sound engine,
Why bother with Dos? You will have no audience that way. No, I'm not familiar with Dose's library, other than the fact that it always says my IRQ may or may not be conflicting. : PWhy bother with Dos? You will have no audience that way.
I don't have very much experience in the 3D Engines field (just reading from web and studying you're engines which by the way ARE AWESOME) and the only things I want to make the engine is for pleasure and to gain more experience in the domain (I love this stuff. It's my life!). I want to make an engine like yours (I hope) but without looking on the source code or somthing like that: I want to gain experience by thinking myself (after viewing your engine features). I know that not using Windows's advantages (like OpenGL, DirectX) I can learn a lot more. I don't want to pass directly to Windows, maybe in a few months I will.
I don't know; I guess I'm going to make my own sound library (on Sound Blaster probably) but I don't know how to reproduce midi files and I don't know where to start form. Can you give me a hint?
Thank you very much Ken!I know that not using Windows's advantages (like OpenGL, DirectX) I can learn a lot more.
That's not a good reason to use DOS. You can do everything in Windows at the lowest level. I'd still be using DOS if that wasn't the case : ) The problem is: Microsoft makes it hard to find this information because they've been flooding their documentation with high-level .NET crap for the last 5 years.
For graphics, use DirectDraw. For keyboard and mouse, use DirectInput. For sound, use DirectSound or ASIO. (ASIO is a better API for low level, but it's not widely supported yet). You can avoid learning all these API's by using a wrapper library such as SDL. Or, if you like my personal coding style, you are welcome to use my own Windows wrapper called WinMain. (WinMain is included with the Voxlap source code. Winmain.cpp and sysmain.h can be separated from the rest of the Voxlap source files).I don't know how to reproduce midi files
Here's a great site for technical MIDI information:
http://www.borg.com/~jglatt/- But that wouldn't make my engine slower? But I think it would make it much better on quality level. I guess it would be a quality versus speed choice wouldn't be? What do you advice me? I mean, you felled nothing for the old dos when you passed to Windows?
- If you don't make to much use of Windows multi-tasking capabilities while running you're game, there won't be any difference in speed, Also you don't have to rely on DirectX or OpenGL, just create you're framebuffer much like in DOS. Also you can make even use of window's nice api's callback functions that deliver you with very useful information in fast and easy ways, making the whole progress of programming more efficient. Spend you're time so you have the most gain out of it. Also you can aim on creating a fast engine that many people will have a chance actually to "see".
Don't forget that if someone wants to run you're engine and he can't (due DOS dependencies), in his eye you're engine is simply broken. - Thanks for the hints psychorosti !!! You're very nice. But I have a huge problem. I don't have much time to finish the engine because I'm in my highschool spare time (summer vacancy) now (I have only 2 months left :( ) and the next year I'm going to take my exams for entering on a college.
But that isn't the real problem. The problem is I do not know how to program in Windows (I only programmed on code generators like Delphi, C++ Builder, Visual Basic and others). If you guys could hint me with some good links on Windows programming, DirectX/OpenGl tutorials (everything), and this kind of stuff I'd be graitfull. I know I'm a bbbbeeeginer but I want to learn more and more. - Ok, using google you might get into millons of Tutorial Sites beginning to programm with DirectX and OpenGl. You should make a search on you're own to pick what you like best. But in case you are even to bussy to do that in the moment, make a stop here in the meantime: www.codeproject.com
- Thanks psychorosti!
Spend you're time so you have the most gain out of it.
Yes you're right with this but I'm affraid that it will take me a long time to learn Windows programming stuff with the things which involves. (I already began to make the engine in DOS for over 2 weeks). Wouldn't be better I could just do it on DOS and porting it later on Windows?
I don't want to upset you and Ken because you guys gave me the best advice but I consider I'm not ready to pass to Windows (I'm not as good as you guys, even by far). When Ken passed to Windows he knew all the mechanisms of the PC in totality.He knew everything from programming the video card to modem, or network card. I was thinking from a long time ago that as soon as I get my exams I'm going to pass to Windows.
Thanks again very much! You were very helpfull! - Porting to Windows any Dos programm involves more work than writing the whole stuff from scratch again (well, at least a fully featured 3d-engine) if you aim to get most out of you're system (or similar setups like yours).
Of course you have to learn a few things before getting ready to use windows and its inner workings. But dont forget you spend this time also for future projects! Spending time to learn DOS won't help much for the "future"...