Note that there are some explanatory texts on larger screens.

plurals
  1. POReceiving audio data from multiple sources and merging them into a wave file
    primarykey
    data
    text
    <p>I'm using C# and DirectSound to record audio and send it across a local network to another computer that receives the data and saves it into a wave file. </p> <p>I used similar <a href="http://blogs.microsoft.co.il/blogs/tamir/archive/2008/12/25/capturing-and-streaming-sound-by-using-directsound-with-c.aspx" rel="nofollow noreferrer">code for recording</a> and similar <a href="https://stackoverflow.com/questions/6729594/writing-contents-of-a-directsound-capturebuffer-to-a-wav-file-in-c-sharp">for saving</a> the wave file (using NAudio).</p> <p>Saving all received bytes into a wave file works. But, I would like to receive audio from multiple computers and merge it into a single wave file.</p> <p>I tried to record two separate wave files, one for each client, then merging them together. However, my naive approach does not provide any means of synchronization. The resulting wave files differ in length by at least 5 seconds and cannot be appropriately merged.</p> <p>So, here are my questions:</p> <p>1) How can I take audio bytes received from a network and save them into a wave file in such way that the resulting file plays back audio at the correct time? </p> <p>For instance, I record 100 seconds of audio and send it across the network. But, only 95 seconds of audio bytes are actually recorded. The missing 5 seconds results from the accumulation of the small delays that occur while I send packets. </p> <p>So, how can I synchronize those 95 seconds of audio to playback at the right time, during 100 seconds?</p> <p>2) How can I mix the audio bytes I receive from multiple clients to obtain a single wave file that plays the audio of all clients in sync?</p> <p>Please let me know if I need to clarify my question. I appreciate any assistance!</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload