Sound unit

I need sound unit that can play multiple waves simultaneously, and can play one wave i.e. from start and from half simultaneously (i.e. one explosion sound covering earlier explosion, but now setting it of (as in all games)).
It should auto-detect sound card, and work with multiple sound cards. (differents SBs, maybe Adlib, etc.). I'll increase points if it's too difficult.
mitya83Asked:
Who is Participating?
 
girts063098Connect With a Mentor Commented:
Here it is:
http://ikaruss.r1g.edu.lv/~girt/code/svsbmix.pas

if you have any problems you can ask me, i have used this unit in one game...

0
 
harrysCommented:
Take a look at ftp://x2ftp.oulo.fi this is the primary source for msdos game programming related information.
0
 
mitya83Author Commented:
I cannot contact with it :(
0
Cloud Class® Course: C++ 11 Fundamentals

This course will introduce you to C++ 11 and teach you about syntax fundamentals.

 
harrysCommented:
a typo I always make, sorry
ftp://x2ftp.oulu.fi/
0
 
quanghocCommented:
 I'm sorry, I have a question. What directory can i get this source ?
0
 
harrysCommented:
The directory ftp://x2ftp.oulu.fi/pub/msdos/programming/mxcode/00index.html hold sources in various languages concerning sound hardware programming.
x2ftp is generally a good source for msdos game/demo/lowlevel stuff
0
 
mitya83Author Commented:
Lots of stuff, but I can't find exactly what I want. I need the unit that can "overlay" sounds (play them in one time), and for each sound define pan (how left or right on speakers) and volume. Better wav's
0
 
PBallCommented:
You might also want to take a look at www.hornet.org (the mother of all euro demo site :) ).  They got a code section out there that might have what you are looking for.
0
 
scrapdogCommented:
To "overlay" sounds you simply add the samples arithmetically.  Of course this would drastically increase the overall loudness.  Therefore it is better to take the average of each sample for the resultant sample.
0
 
mitya83Author Commented:
Hey! Have you done any games before, any of you? Then you should have such a unit! I need it, not comments, if I wanted to do it myself, I'd not ask such questions, so, PLEASE, say me where I can get this!
0
 
mitya83Author Commented:
Hey! Have you done any games before, any of you? Then you should have such a unit! I need it, not comments, if I wanted to do it myself, I'd not ask such questions, so, PLEASE, say me where I can get this!
0
 
mitya83Author Commented:
PLEASE, HELP ME!!!!!!!!!!!!!
0
 
scrapdogCommented:
> and for each sound define pan (how left or right on speakers

Here is a simple algorithm you can use to set the pan position:

if $00 is hard left and $ff is hard right:

LeftChannelVolume := (1-p/255)*v;
RightChannelVolume := (p/255)*v;

where p is the pan position and v is the volume.
0
 
girts063098Commented:
I have such unit, but it works only with SB and SB compatible. Tomorrow i'll put it in my web page, so you have to wait a bit...
0
 
ZeusGodCommented:
 Hey girts, where is Unit GXMS.PAS ?
0
 
ZeusGodCommented:
 Hey girts, where is Unit GXMS.PAS ?
0
 
girts063098Commented:
0
 
mitya83Author Commented:
It looks pretty fine, but on my SB AWE64 gold initialisation failed. (initsb). Maybe I'm doing something wrong? Please give me source to play 2 waves simultaneously (example pas program).
0
 
jack_p50Commented:
init failed on my card too. maybe some bug or misunderstand?
0
 
girts063098Commented:
ok, ill write a small test programm
0
 
mitya83Author Commented:
Please hurry, i'll need it very soon. post it here, my mail client no longer works (i overloaded my 2,5 Mb mailbox).
0
 
girts063098Commented:
Here it is:
http://ikaruss.r1g.edu.lv/~girt/code/sb.pas

and 2 data files:
http://ikaruss.r1g.edu.lv/~girt/code/0.ra
http://ikaruss.r1g.edu.lv/~girt/code/1.ra

I tested it on 3 machines with SB16, SB32, Crystal(SB compatible)
with only himem.sys loaded, and it worked perfectly.

0
 
mitya83Author Commented:
Hey, great! My error was InitSb(220,5,1,5) instead of InitSb(220h,5h,1h,5h)
The last question : what about volume control for each sound, and panning?
0
 
girts063098Commented:
You cant control volume for each sound with this unit, you have to do it yourself, by multiplying each byte(word, dword) with 0 to 1. And about panning as I remember this unit could play stereo also, so you have to multiply each channel with different constant.

0
 
mitya83Author Commented:
ok
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.