From: Thor A. <ta...@to...> - 2011-10-17 11:43:44
|
On Mon, Oct 17, 2011 at 01:15:06PM +0200, Luigi Rensinghoff wrote: > Hi List > > > i am looking for a solution the the following task > > I know it is possible but i am not to good in scripting. > > I am on OS X - (using sox in the commandline) but scripting can be done here to. > > There is a folder with lot of split audio-files > > Applause_L.wav > Applause_R.wav > Atmosphere_1_L.wav > Atmosphere_1_R.wav > > Now i would like the script to join the corresponding files, but > therefore to check if the name is identical, except the "_L"/"_R" - > part. > > And the End i would like to call the file i.e. Applause_ST.wav. > > I know it has to be in a for next loop and may need some regexp-stuff > > The actual sox-line is: sox -M input.l.wav input.r.wav output.wav > > thats the easy part. > > Anybody willing and able to help ?? I'll take a stab. This assumes you are using bash as your shell and that the files are named correctly: 8<--------8<--------8<--------8<--------8<--------8<-------- for wav in *_L.wav; do sox -M "$wav" "${wav%*_L.wav}_R.wav" "${wav%*_L.wav}_ST.wav" done 8<--------8<--------8<--------8<--------8<--------8<-------- -- best regards Thor Andreassen |