How to merge WAV files using C#

WAV Merger .NET API

Developers can use GroupDocs.Merger to concatenate multiple WAV audio files in the desired sequence and save them as a single file.

About WAV File Format

The WAV (Waveform Audio File Format) is a popular audio file format that is commonly used for storing uncompressed audio data. The format doesn’t apply any compression to the bitstream and stores the audio recordings with different sampling rates and bitrates. It has been and is one of the standard formats for audio CDs.

WAV files are widely supported by audio software and hardware devices, making them a versatile choice for audio recording, editing, and playback.

Download and Configure

Use the downloads section to obtain the API DLLs, MSI installer, or NuGet package:

PM> Install-Package GroupDocs.Merger

Source Audio Files

How To Merge Several WAV Files Into A Single File

The following example demonstrates how to combine multiple audio files with several lines of C# code:

  • Create an instance of the Merger class and pass the source audio file path as a constructor parameter. You may specify absolute or relative file paths as per your requirements.
  • Add another audio file to merge with the Join method. Repeat this step for other audio files you want to merge.
  • Call the Save method and specify the filename for the resulting audio file as a parameter.
// Load the source WAV file
using (var merger = new GroupDocs.Merger.Merger(@"c:\sample1.wav"))
{
    // Add another WAV file to merge
    merger.Join(@"c:\sample2.wav");
    // Merge WAV files and save result
    merger.Save(@"c:\merged.wav");
}

Result Of Joining WAV Files

Code Examples

Please find more use-cases and complete C# sources of our backend and frontend examples and try them for free!

Combining WAV Live Demo

GroupDocs.Merger for .NET provides an online WAV Merger App, which allows you to try it for free and check its quality and accuracy.