|
mp3 conversion using sox automate with cron
Hi, im trying to convert audio file from .gsm to .mp3 format using sox and lame to be use in asterisk. I created "Makefile" in the audio directory (you can see it below). When i type the command in the CLI it works but when I automate the task using cron it didnt work.
Cron:
* * * * * cd /path/to/my/dir; make mp3
Makefile:
DIRWAV = $(shell dir *.wav)
ALLWAV = $(DIRWAV:.wav=.mp3)
DIRGSM = $(shell dir *.gsm)
ALLGSM = $(DIRGSM:.gsm=.mp3)
mp3: $(ALLGSM) $(ALLWAV)
%.mp3: %.wav
nice lame --quiet -h --preset phone "$?" "$@"
rm -f "$?"
%.wav: %.gsm
nice sox "$?" -r 8000 -c 1 "$@"
rm -f "$?"
Last edited by robteks; 07-17-2008 at 11:12 PM.
|