change my class to instead use naudio to combine wav files and even if they have different formats.

using System;
using System.Collections.Generic;
using System.IO;

public class WavCombiner
{
    /// <summary>
    /// Concatenates multiple WAV files into a single WAV file.
    /// Assumes all WAVs have the *same format* (sample rate, bits per sample, channels).
    /// </summary>
    /// <param name="inputFiles">List of WAV file paths to combine in order.</param>
    /// <param name="outputFile">Output WAV file path.</param>
    public void CombineWavFiles(List<string> inputFiles, string outputFile)
    {
        if (inputFiles == null || inputFiles.Count == 0)
            throw new ArgumentException("No input files specified.");

        // Read header from first file to get format info
        byte[] header = new byte[44];
        int sampleRate = 0;
        short bitsPerSample = 0;
        short channels = 0;
        int byteRate = 0;
        short blockAlign = 0;

        // We'll accumulate audio data in a MemoryStream first
        using (var outputStream = new MemoryStream())
        {
            bool firstFile = true;

            foreach (string file in inputFiles)
            {
                using (var fs = new FileStream(file, FileMode.Open, FileAccess.Read))
                {
                    if (fs.Length < 44)
                        throw new InvalidDataException($"File too short to be a valid WAV: {file}");

                    byte[] fileHeader = new byte[44];
                    fs.Read(fileHeader, 0, 44);

                    // Read format info from header
                    if (firstFile)
                    {
                        Array.Copy(fileHeader, header, 44);

                        channels = BitConverter.ToInt16(fileHeader, 22);
                        sampleRate = BitConverter.ToInt32(fileHeader, 24);
                        byteRate = BitConverter.ToInt32(fileHeader, 28);
                        blockAlign = BitConverter.ToInt16(fileHeader, 32);
                        bitsPerSample = BitConverter.ToInt16(fileHeader, 34);

                        firstFile = false;
                    }
                    else
                    {
                        // Validate that format matches first file
                        short fileChannels = BitConverter.ToInt16(fileHeader, 22);
                        int fileSampleRate = BitConverter.ToInt32(fileHeader, 24);
                        short fileBitsPerSample = BitConverter.ToInt16(fileHeader, 34);

                        if (fileChannels != channels || fileSampleRate != sampleRate || fileBitsPerSample != bitsPerSample)
                            throw new InvalidDataException($"WAV format mismatch in file {file}");
                    }

                    // Read audio data chunk size (subchunk2Size in header at offset 40, 4 bytes)
                    int subchunk2Size = BitConverter.ToInt32(fileHeader, 40);

                    // Read audio data
                    byte[] data = new byte[subchunk2Size];
                    int bytesRead = fs.Read(data, 0, subchunk2Size);
                    if (bytesRead != subchunk2Size)
                        throw new InvalidDataException($"Couldn't read full audio data from {file}");

                    outputStream.Write(data, 0, subchunk2Size);
                }
            }

            // Now we have all audio data concatenated in outputStream
            int combinedDataLength = (int)outputStream.Length;

            // Update header fields for combined file
            // ChunkSize = 36 + subchunk2Size
            int fileSize = 36 + combinedDataLength;
            byte[] fileSizeBytes = BitConverter.GetBytes(fileSize);
            Array.Copy(fileSizeBytes, 0, header, 4, 4);

            // Subchunk2Size = combined audio data length
            byte[] subchunk2SizeBytes = BitConverter.GetBytes(combinedDataLength);
            Array.Copy(subchunk2SizeBytes, 0, header, 40, 4);

            // Write output file
            using (var outFs = new FileStream(outputFile, FileMode.Create, FileAccess.Write))
            {
                outFs.Write(header, 0, 44);
                outputStream.Position = 0;
                outputStream.CopyTo(outFs);
            }
        }
    }
}