|
From: Jan S. <ha...@st...> - 2013-01-29 13:38:22
|
On Jan 29 11:51:55, alf...@we... wrote: > Hello, > > I am new to Mac OS X and scripting. > > I am recording talks as .WAV files with left channel speaker´s voice and > right channel translator´s voice. > Once in a while I want to split the .WAVs into two .MP3s with same > filename but in folders ./speaker/*.MP3 and ./translation/*.MP3. > I solved that for windows with a batch file, onto which I drag and drop > a set of files and the batch does the job (see batch below). > > Now I need the same funcion on a Mac. I welcome any support to ease the > implementaton: > - I have a folder with SoX for Mac OSX > - A script seems to be the equivalent to the batch. Hints for an easy > start? Which scripting tool? How to call SoX? How to pass the files to > split? > - I got a LAME-library libmp3lame.lylib from > http://www.thalictrum.com/en/products/lame.html. Will this work and > where do I place it? > > Thanks > Alfred > > And here the windows batch file > rem > --------------------------------------------------------------------------------- > rem > rem Batch to split 2-channel .wav´s into 2 .mp3´s > rem Place this file in the same folder as sox.exe > rem Drag and drop a selection of files onto the batch file. > rem > > cd %~dp0 > mkdir speaker > FOR %%A IN (%*) DO sox %%A -C 48 "speaker/%%~nA.mp3" remix 1 > mkdir translation > FOR %%A IN (%*) DO sox %%A -C 48 "translation/%%~nA.mp3" remix 2 > pause mkdir -p speaker mkdir -p translation for i in *wav ; do sox $i speaker/${i%wav}mp3 remix 1 sox $i translation/${i%wav}mp3 remix 2 done If you are to work on a UNIX system, you want to get familiar with scripting in general. "man sh" is a good starting point. |