NAudio是在codeplex上的开源项目,地址: http://naudio.codeplex.com/。
使用NAudio合并mp3文件示例代码如下:
public static void Combine(string[] inputFiles, Stream output)
{
foreach (string file in inputFiles)
{
Mp3FileReader reader = new Mp3FileReader(file);
if ((output.Position == 0) && (reader.Id3v2Tag != null))
{
output.Write(reader.Id3v2Tag.RawData, 0, reader.Id3v2Tag.RawData.Length);
}
Mp3Frame frame;
while ((frame = reader.ReadNextFrame()) != null)
{
output.Write(frame.RawData, 0, frame.RawData.Length);
}
}
}
转载自:http://outofmemory.cn/code-snippet/1906/c-usage-open-source-project-NAudio-hebing-mp3-file
网友评论