Solved

Sound unit

Posted on 1999-01-10
25
291 Views
Last Modified: 2010-04-16
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.
0
Comment
Question by:mitya83
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 9
  • 6
  • 3
  • +5
25 Comments
 
LVL 2

Expert Comment

by:harrys
ID: 1216887
Take a look at ftp://x2ftp.oulo.fi this is the primary source for msdos game programming related information.
0
 

Author Comment

by:mitya83
ID: 1216888
I cannot contact with it :(
0
 
LVL 2

Expert Comment

by:harrys
ID: 1216889
a typo I always make, sorry
ftp://x2ftp.oulu.fi/
0
Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

 
LVL 1

Expert Comment

by:quanghoc
ID: 1216890
 I'm sorry, I have a question. What directory can i get this source ?
0
 
LVL 2

Expert Comment

by:harrys
ID: 1216891
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
 

Author Comment

by:mitya83
ID: 1216892
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
 
LVL 6

Expert Comment

by:PBall
ID: 1216893
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
 
LVL 5

Expert Comment

by:scrapdog
ID: 1216894
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
 

Author Comment

by:mitya83
ID: 1216895
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
 

Author Comment

by:mitya83
ID: 1216896
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
 

Author Comment

by:mitya83
ID: 1216897
PLEASE, HELP ME!!!!!!!!!!!!!
0
 
LVL 5

Expert Comment

by:scrapdog
ID: 1216898
> 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
 
LVL 1

Expert Comment

by:girts063098
ID: 1216899
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
 
LVL 1

Accepted Solution

by:
girts063098 earned 300 total points
ID: 1216900
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
 

Expert Comment

by:ZeusGod
ID: 1216901
 Hey girts, where is Unit GXMS.PAS ?
0
 

Expert Comment

by:ZeusGod
ID: 1216902
 Hey girts, where is Unit GXMS.PAS ?
0
 
LVL 1

Expert Comment

by:girts063098
ID: 1216903
0
 

Author Comment

by:mitya83
ID: 1216904
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
 
LVL 4

Expert Comment

by:jack_p50
ID: 1216905
init failed on my card too. maybe some bug or misunderstand?
0
 
LVL 1

Expert Comment

by:girts063098
ID: 1216906
ok, ill write a small test programm
0
 

Author Comment

by:mitya83
ID: 1216907
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
 
LVL 1

Expert Comment

by:girts063098
ID: 1216908
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
 

Author Comment

by:mitya83
ID: 1216909
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
 
LVL 1

Expert Comment

by:girts063098
ID: 1216910
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
 

Author Comment

by:mitya83
ID: 1216911
ok
0

Featured Post

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
How do you invoke TCharHelper 1 2,030
Can you change icon dynamically in Delphi? 3 731
Old Old code - Turbo Pascal issue 17 110
ADO Memory leak with DELPHI 2007 37 210
The world seems to conceive of a curious bubble separating IT from “the business.”  More so than just about any other pursuit in the commercial world, people think of IT as some kind of an island.
Original post  on Monitis Blog. Web performance monitoring is broken into two camps: passive and active. Passive monitoring is defined as looking at real-world historical performance by monitoring actual log-ins, site hits, clicks, requests for…
Exchange organizations may use the Journaling Agent of the Transport Service to archive messages going through Exchange. However, if the Transport Service is integrated with some email content management application (such as an antispam), the admini…

730 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question