That's the approach we're using, and yes, it's reliable. I believe it's the standard way of doing a mix with PCM audio data.<div><br></div><div>You can do this mixing either on an intermediate server, or on the client, and each have their benefits. Doing it on the client requires less server-side horsepower, but it also means more bandwidth requirements (since you have n number of inbound streams instead of one, along with n outbound streams). Doing it on an intermediate server means less bandwidth is required, but it requires more processing (since you have to first decode the packets, then mix them, then re-encode them). It also means that it's somewhat more difficult on the client to control the volume of each stream independently, since once they're mixed they can't easily be separated out again.<br clear="all">
<br>Ken Smith<br>Cell: 425-443-2359<br>Email: <a href="mailto:ken@alanta.com" target="_blank">ken@alanta.com</a><br>Blog: <a href="http://blog.wouldbetheologian.com/" target="_blank">http://blog.wouldbetheologian.com/</a><br>
<br><br><div class="gmail_quote">On Thu, Oct 14, 2010 at 7:07 AM, Vishal Jain <span dir="ltr"><<a href="mailto:cse.vishal@gmail.com">cse.vishal@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
Another approach that I have come across is to decode all speex audio streams and add their 16 bit signed PCM values clipping values above 2^15-1 and below -2^15. Is this a reliable appproach?<div><div></div><div class="h5">
<br><br><div class="gmail_quote">
On Thu, Oct 14, 2010 at 3:54 PM, Vishal Jain <span dir="ltr"><<a href="mailto:cse.vishal@gmail.com" target="_blank">cse.vishal@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Hello,<br><br>In a way similar to speexclient voip example, I want to have a voip application where 3 or more users can interact. This creates the following problems "1. How to playback 2 or more audio streams such that they appear overlayed (parallel)". The audio streams are speex encoded.<br>
<br>I have few approaches in mind.<br><br>1. Create multiple decoder states and multiple ALSA audio playback device. But if I do this in the same thread, voice will appear sequential (slightly displaced in time) rather than overlayed. This issue will get more deep as the number of users increase. Moreover creating multiple OS threads will also not solve the issue due to latency issues.<br>
<br>2. Use multiple channels in decoder but not sure how this can be done.<br><br>3. Using intermediate server to merge/overlay multiple speex audio streams encoded at same sampling rate. I can't find an appropriate function/algorithm in speex code to do so.<br>
<br>Please suggest an appropriate solution. <br><br>Regards,<br><font color="#888888">Vishal<br>
</font></blockquote></div><br>
</div></div><br>_______________________________________________<br>
Speex-dev mailing list<br>
<a href="mailto:Speex-dev@xiph.org">Speex-dev@xiph.org</a><br>
<a href="http://lists.xiph.org/mailman/listinfo/speex-dev" target="_blank">http://lists.xiph.org/mailman/listinfo/speex-dev</a><br>
<br></blockquote></div><br></div>