C# : concatenate 2 MP3 files

后端 未结 6 2114
小鲜肉
小鲜肉 2021-01-05 13:26

I tried to concatenate 2 MP3 files using the code below. I got a new file which I can play the first half of (complete first file), but the second half is silent. The length

6条回答
  •  小蘑菇
    小蘑菇 (楼主)
    2021-01-05 14:10

    Simple:

    public static void Combine(string[] mp3Files, string mp3OuputFile)
    {
        using (var w = new  BinaryWriter(File.Create(mp3OuputFile)))
        {
            new List(mp3Files).ForEach(f => w.Write(File.ReadAllBytes(f)));
        }
    }
    

提交回复
热议问题