如何在C#中串联WAV文件 [英] How to concatenate WAV files in C#

查看:117
本文介绍了如何在C#中串联WAV文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有2个wav文件,我想将它们与两个音轨连接成一个文件.

该任务是否有任何api或.NET中的某些内置命令,我可以以某种天才的方式使用它来使该任务成为可能?

非常感谢您的帮助. :)

解决方案

如果我没记错的话,可以将第二个文件中的字节追加到第一个文件的末尾.如果有任何标头数据,则将其排除在外(请参见此处)

请注意,在两个剪辑之间您可能会听到咔嗒声或弹出声,因为将不会有任何融合.您可以通过淡入淡出来解决此问题(逐渐将最后几毫秒的值减小到中心值).

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. :)

解决方案

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).

这篇关于如何在C#中串联WAV文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆