Integrated digital audio

Please use this Board for QBasic related requests ( file research, programming, etc.)

Moderators:Administrator, Global Moderator

Post Reply
Guest
Integrated digital audio

Post by Guest » Sun Mar 02, 2003 5:02 am

Does anyone know anything at all about programming Integrated digital audio? I can't get it to work with anything except DQ4QB++ and I need faster sounds than it can produce for the game I am working on.

User avatar
GPfault
Jr. Member
Posts:13
Joined:Mon Dec 02, 2002 9:14 pm

Re: Integrated digital audio

Post by GPfault » Tue Mar 11, 2003 9:19 pm

I assume you're talking about using a sound card?

You should be aware of how any "sound library" will work:

Only one "sound stream/buffer" can be active at once.  "Multiple sounds" at once is actually a bunch of sounds being combined into one chunk, then sent out to the sound card as a sum of samples.  Unless the sound card itself is capable of multiple sounds, this mixing will take some time.

There are quite a few tradeoffs:

Latency vs speed.

The sound card works faster if it has fewer but larger packets of sound.  Once a packet has been sent out, any new sounds have to wait for the next to be sent before their blendings are heard.

The quicker the packets, the more overhead you encounter.

Also, because QB is a DOS program, any I/O port (DMA, PIC, TIMER, sound card) access has to go through a bunch of red tape because Windows is protective of those ports and has to monitor them.  (Some other program might be using the sound card)

I can't help you choose a library, but I hope this gives you a peek at what a library has to go through.

If you're considering writing your own, try going to developer.creative.com to get a manual.  UNDER NO CONDITIONS are you to distribute it (You could get in trouble).  You would be perfectly all-right to read it yourself though.

Dr_Davenstein
QBasic God
Posts:166
Joined:Tue Mar 25, 2003 12:45 am
Location:U.S.A.
Contact:

Re: Integrated digital audio

Post by Dr_Davenstein » Tue Mar 25, 2003 1:05 am

Thanks for the link.I did come up with one solution,but it is'nt really a solution... 8)
What I was doing was making a pinball game.I needed to have a "bouncing"sound play several times within one second.Instead of trying to play the same sound several times I just re-recorded the sound like this.

if bounces=1 then soundfile$="onebounce"
if bounces=2 then soundfile$="twobounce"
etc...
I'm sure you get the point.
It does work alot better this way.
DS4QB++ was totally free and I'm sure that Lithium went to alot of trouble to make it for us.
So I'm not complaining,I was just curious.   ;D
Come check out [url=http://www.freebasic.net/forum/index.php]FreeBASIC[/url]. The syntax is based on QuickBasic, but it expands to use pointers, operator overloading, etc... The list goes on and on!

Post Reply