From Anthony Hamilton · 1996-03-30 00:02 · #75154 in R25C
Hiya 0ly! OG> stuck with the sound routines. I have no idea how to autodetect a OG> sound card, It's not a good idea to auto-detect sound hardware by scanning ports and stuff. This can crash some SCSI machines and it's not very reliable. Do you have a sound library? If not, you should really get one. Coding one from scratch and getting it to play MODs is a giant project in its self; especially if you want to support more than the basic SoundBlaster. The only sound library I know alot about is the Digital Sound and Music Interface (DSMI) by Otto Chrons. Although, he's stopped developing it now. It supports all the major sound cards and can play just about any type of music module (not just .MOD). I'm on the look-out for a different library now though... As for auto-detection, scanning the enviornment variables in DOS will tell you what card(s) are availible /and/ their configuration; assuming these are valid (and it'd be pretty darn silly if they weren't). Else you could let the user choose the settings before the demo runs. Some good demos do this. OG> play a .mod (or any other sample), Playing mods is very complex; especially if you want to support all the different effects. I've known MOD gurues to have trouble with this. Use a library. OG> or merge the PCX, .mod and code together so the demo isn't OG> distributed as three seperate files. Good idea. I do this sort of thing... Er, but I haven't worked-out how to merge the .EXE together with my data file. It's easy to concatinate the .MOD and .PCX file. As long as you know the file offset of the second file, you can seek to that point and read in the data as if you had just opend the file seperatly. Nothing to it really... but with DSMI I had trouble with music module files, as it has its own function to load the modules; it took a file name as a parameter (one of the many problems with DSMI). I had to re-write this function to take a file handle. There is a way of linking data into your .EXE, though. OG> Any help would be appreciated, esp. source code, but nothing *too* OG> technical please as I am only a beginner! I hope I've been of help. You havn't asked anything specific enough for me to start typing code for you :) You're a programmer, I've just given you some methods. See-ya! - Conan ... This tagline belongs to Anthony Hamilton --- GEcho 1.11+ * Origin: Gunsmoke BBS! 28800! V.34! (01494) 871293 (2:252/174)