Search code examples
c#mergewav

How to concatenate WAV files in C#


I have 2 wav files that I want to concatenate into one file with the two sound tracks.

Is there any api for that task or some built in commands in .NET that can I can use in some genius way to make this task possible?

Many thanks for the help. :)


Solution

  • If I'm not mistaken, you can just append the bytes from the second file to the end of the first. If there is any header data, you'll want to exclude that (see here)

    Be advised that you may hear a click or pop between the two clips, as there will be no blending. You could probably get around this by fading (gradually reducing the values for the last few ms to the center value).