Article View: borland.public.cppbuilder.multimedia
Article #863Re: BCB3 Mixing sound streams together before sending to sound card
From: Tim Reago
Date: Mon, 03 Mar 2003 14:18
Date: Mon, 03 Mar 2003 14:18
13 lines
1390 bytes
1390 bytes
I think this is the basic idea.
int OutSample = 0;
for (int i=0; i<nSamples; i++)
{
for (int j=0; j<nSounds; j++)
{
// SoundMixLevel is from 0 to 1, one for each sound
OutSample += (__int16)((float)SoundMixLevel[j] * (float)Sample[i][j]);
}
OutSample /= nSounds;
// play out sample
}
Technical Details
Message-ID:
<3e6363c4@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.icl.net!newsfeed.fjserv.net!skynet.be!skynet.be!fu-berlin.de!news.boerde.de!nntp.cs.uni-magdeburg.de!PeerFeed.KWeb.on.ca!news.kweb.on.ca!newsgroups.borland.com!not-for-mailReferences:
<3e62fa2d.129022297@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 06:17:37 PST From: "Tim Reago" <timreago@earthlink.net> Newsgroups: borland.public.cppbuilder.multimedia References: <3e62fa2d.129022297@newsgroups.borland.com> Subject: Re: BCB3 Mixing sound streams together before sending to sound card Date: Mon, 3 Mar 2003 09:18:51 -0500 Lines: 15 X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2800.1106 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1106 NNTP-Posting-Host: 165.247.86.244 Message-ID: <3e6363c4@newsgroups.borland.com> X-Trace: newsgroups.borland.com 1046700996 165.247.86.244 (3 Mar 2003 06:16:36 -0800) 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.icl.net!newsfeed.fjserv.net!skynet.be!skynet.be!fu-berlin.de!news.boerde.de!nntp.cs.uni-magdeburg.de!PeerFeed.KWeb.on.ca!news.kweb.on.ca!newsgroups.borland.com!not-for-mail