SoxSharp icon indicating copy to clipboard operation
SoxSharp copied to clipboard

How to use multiple command padding and mixing?

Open sy0514 opened this issue 5 years ago • 1 comments

How to use multiple command padding and mixing? like this : > sox longTimeAutio.wav -p pad 5 0 | sox - -m shortTimeAudio.wav combined.wav

sy0514 avatar Aug 27 '20 02:08 sy0514

Command piping is not supported by SoxSharp. However, I think you can get the same result using the command sox.exe -m shortTimeAudio.wav longTimeAudio.wav combined.wav delay 5, which will mix the two files, starting shortTimeAudio.wav with a delay of 5 seconds into longTimeAudio.wav.

This can be coded using SoxSharp as:

using (var sox = new Sox("sox.exe"))
{
  sox.CustomEffects = "delay 5";
  sox.Process(new string[] { "shortTimeAudio.wav", "longTimeAudio.wav" }, "combined.wav", CombinationType.Mix);
}

(The delay effect is not currently implemented in SoxSharp, so it needs to be entered through the CustomEffects property).

igece avatar Aug 27 '20 08:08 igece