MFMultimedia

Q: script shell using LAME

Hi,

I'm new with this stuff but trying use script shell into automator for converting an aiff audio file into an mp3 file.

 

Open automator choose service, then from utility choose run script shell and write this siple lines:

 

for f in "$@"

do

/usr/local/bin/lame -b 256 -m j -h "$@" "${f/.*}".mp3

done

afplay '/Users/prod00/Library/Sounds/Converted.aif'

 

The script works but not properly, in effect decode aiff to mp3 if the file is short (about 40sec.less) and then stop. But if I try to decode for example 3min. the script continue and never stop. Then I must stop the automator service from menubarand the file is decoded partially.

 

Can sameone tell me where am I wrong?

 

Thanks

iMac, Mac OS X (10.7.2)

Posted on Mar 22, 2012 1:57 AM

Close

Q: script shell using LAME

  • All replies
  • Helpful answers

  • by MFMultimedia,Solvedanswer

    MFMultimedia MFMultimedia Mar 29, 2012 10:04 AM in response to MFMultimedia
    Level 1 (0 points)
    Mar 29, 2012 10:04 AM in response to MFMultimedia

    For everyone who is interest I've find myself a solution this is the code:

     

    for f in "$@"

    do

    /usr/local/bin/lame -b 128 -m j -h -S "$f" "${f/.*}".mp3;

    done

     

     

    This encode an audio file to mp3 128K bitrate, stereo, high quality

     

     

    Take care