Archived

This topic is now archived and is closed to further replies.

bigbox

Does anybody knows this question about sound?

Recommended Posts

bigbox    122
I have a problem with my video conferencing project: generally like this: Computer A has a microphone and recording some sound. Computer B has a microphone and recording some sound. sound A and sound B would be transimitted to Computer C at real time. And Computer C would mix sound A, B( Just A + B is OK! )Does any body know where ''s some code about this problem or some tech notes for me. Thanks a lot!!!

Share this post


Link to post
Share on other sites
Kylotan    10002
Adding them together is a matter of... adding them together. You can essentially just add the samples in the mixer as they occur. You will probably get some clipping which will sound like distortion, especially if both sounds are pretty loud. You can fix this with some sort of real-time limiter or compressor, but there is no easy or foolproof answer to that.

[ MSVC Fixes | STL | SDL | Game AI | Sockets | C++ Faq Lite | Boost | Asking Questions | Organising code files ]

Share this post


Link to post
Share on other sites
henrym    103
Couldn''t you just hav two sound sources and then tell them both to play at the same time?

Wouldn''t that simplify things?

Henrym

Share this post


Link to post
Share on other sites
a person    118
yeah dsound does this easy (just use two secondary sound buffers and let dsound handle the actual mixing). software mixing is easy. just use an avg of the samples. since samples are 16bit, adding them results in something less then a 32bit answer (ie max of a 32bit int). divide by 2, and you got exactly something that should be at most 16bit. this will work even up to 10 samples. no compressor or limiter is required. the problem is that being an avg, samples will get a bit quieter if you have silent "channels". look on the net for some fast ways to do this.




Share this post


Link to post
Share on other sites