天天看點

兩個音軌合并,合并兩個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.