🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: borland.public.cppbuilder.multimedia
Article #864

Re: BCB3 Mixing sound streams together before sending to sound card

#864
From: feklar
Date: Mon, 03 Mar 2003 21:18
44 lines
2929 bytes
Thanks, there are some useful infoZ in there.

I was thinking along the lines of a continuous FIFO ring buffer and
monitoring the buffer pointer's position, so there is continuous
output to the sound card, and so I know where the timebase of the
buffer is so when the buffer can accept new data I can put it in
there.

Will using repeated calls to the Borland sound playing functions to
send a buffer segment indroduce audible clicks?    Are you suggesting
sending the data to the soundcard one byte at a time, and is this the
most commonly used method?

The sounds would be in internal and external resources, all in the
same bitrate / frequency / format.  Since they will be reasonable in
size I will load them all into RAM on loading / startup, maybe
addressing them as 

WAVSOUND sounds[250];
(The WAV data lengths will be different)

using a struct for WAVSOUND
#define struct  WAVSOUND {
LONG soundlength;
SOUND * sounddata;
};
SOUND will be a SHORT PTR pointing to the start of the sound data for
each sound, initialized to the address of the sound resource.

At any time at most I might be in the process of sending as many as 50
or 55 different waveforms to the buffer out of the 150.  (Say 30
crickets chirping at 30 different sound levels, 10 frogs singing
(sounds like crickets almost) at 10 different volume levels, and three
frogs croaking at 3 different levels and maybe a couple of nighthawks
calling or mabe a roll of thunder in the distance).   I need to keep
track of all the data pointers and introduce new streams and end those
that are finished.

What you suggest, it sounds like it will be faster than the soundcard
can handle so I will have to wait for the sound card to be ready,
which is what I want of course.

What is the function to check whether the card is ready to accept new
data?
Technical Details
Message-ID: <3e63c01b.29654919@newsgroups.borland.com>
Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-02!sn-xit-06!sn-xit-09!supernews.com!news.maxwell.syr.edu!newsfeed.frii.net!newsfeed.frii.net!out.nntp.be!propagator-sanjose!news-in-sanjose!in.nntp.be!newsfeed01.tsnz.net!newsfeeds.ihug.co.nz!ihug.co.nz!newsgroups.borland.com!not-for-mail
References: <3e62fa2d.129022297@newsgroups.borland.com> <3e6363c4@newsgroups.borland.com>

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: 10d0fc,cc0e39d22fa8fc93
X-Google-Attributes: gid10d0fc,public
X-Google-ArrivalTime: 2003-03-03 13:24:49 PST
From: feklar@mykswomail.com (feklar)
Newsgroups: borland.public.cppbuilder.multimedia
Subject: Re: BCB3 Mixing sound streams together before sending to sound card
Date: Mon, 03 Mar 2003 21:18:42 GMT
Organization: where the dishonored go when they die
Reply-To: feklar@mykswomail.com
Message-ID: <3e63c01b.29654919@newsgroups.borland.com>
References: <3e62fa2d.129022297@newsgroups.borland.com> <3e6363c4@newsgroups.borland.com>
X-Newsreader: Forte Free Agent 1.11/32.235
NNTP-Posting-Host: 65.64.78.249
X-Trace: newsgroups.borland.com 1046726271 65.64.78.249 (3 Mar 2003 13:17:51 -0800)
Lines: 46
Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-02!sn-xit-06!sn-xit-09!supernews.com!news.maxwell.syr.edu!newsfeed.frii.net!newsfeed.frii.net!out.nntp.be!propagator-sanjose!news-in-sanjose!in.nntp.be!newsfeed01.tsnz.net!newsfeeds.ihug.co.nz!ihug.co.nz!newsgroups.borland.com!not-for-mail