天天看点

两个音轨合并,合并两个mp3音频文件合并为一个

两个音轨合并,合并两个mp3音频文件合并为一个

I have two audio files that I need to merge on top of each other. Each mp3 is one side of a conversation, so in theory when I merge these two files together I should hear a complete conversation. Has anybody ever accomplished this in .Net?

I've seen examples of people concatenating audio files together, but I repeat, I don't want to do that. I want to merge/mix two audio tracks so the are on the same audio file.

Any help would be appreciated.

I am looking at the NAudio library. Actual code answers would be very helpful as well.

解决方案

I ended up using Sox to do the merge.

sox.exe -m fileone.mp3 filetwo.mp3 output.mp3

Sox doesn't have support for mp3s so you need to download this version which has those references compiled into the executable. Additionally you can search for the dll and the latest should pick them up.

Use a Process class to call this from .Net.