 |
BorlandTalk.com Borland discussion newsgroups
|
| View previous topic :: View next topic |
| Author |
Message |
Ivan Babikov Guest
|
Posted: Thu Jun 10, 2004 4:48 pm Post subject: Mixing Wave buffers in a voice chat |
|
|
Hello all,
I'm developing voice chat, so I need a way to mix several PCM buffers into
one (for the case if the speakers are speaking vying with each other). As I
understand to mix sounds in Windows I need to use Windows mixers but I
cannot see any stream functions like MixerLineInWrite etc, as for WaveIn/Out
or for ACM.
So, where should I put the wave streams and how can I get the resulting
stream?
Thanks, Ivan.
|
|
| Back to top |
|
 |
George Kashperko Guest
|
Posted: Thu Jun 10, 2004 6:34 pm Post subject: Re: Mixing Wave buffers in a voice chat |
|
|
Hi, Ivan.
I sugges u can either do mixing with own code (calculate average value for
each sample) or try to use DirectSound (build filter graph and mix your
sources with MS PCM Audio Mixer and ten connect it to audio renderer device
or whatever else to get media file instead).
Good luck.
|
|
| Back to top |
|
 |
Alex Lee Guest
|
Posted: Thu Jun 24, 2004 11:56 pm Post subject: Re: Mixing Wave buffers in a voice chat |
|
|
add the buf , e.g.
AudioBuf1[]
AudioBuf2[]
for i := 0 to []
AudioBuf2[i] := AudioBuf2[i] + AudioBuf1[i]
"Ivan Babikov" <babikov-nospam (AT) mail (DOT) ru> дÈëÓʼþ
news:40c8913e (AT) newsgroups (DOT) borland.com...
| Quote: | Hello all,
I'm developing voice chat, so I need a way to mix several PCM buffers into
one (for the case if the speakers are speaking vying with each other). As
I
understand to mix sounds in Windows I need to use Windows mixers but I
cannot see any stream functions like MixerLineInWrite etc, as for
WaveIn/Out
or for ACM.
So, where should I put the wave streams and how can I get the resulting
stream?
Thanks, Ivan.
|
|
|
| Back to top |
|
 |
Ivan Babikov Guest
|
Posted: Fri Jun 25, 2004 5:32 pm Post subject: Re: Mixing Wave buffers in a voice chat |
|
|
| Quote: | for i := 0 to []
AudioBuf2[i] := AudioBuf2[i] + AudioBuf1[i]
|
People say, that is's better to divide the data to avoid overloading and that sqrt(N) is better than N here (N- is the number of voices).
for i := 0 to []
AudioBuf2[i] := (AudioBuf2[i] div sqrt(2) + AudioBuf1[i] div sqrt(2))
|
|
| Back to top |
|
 |
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
|