[LAU] No ffmpeg, help convert script for Sox

From: Kazakore <dj_kaza@email-addr-hidden>
Date: Tue Nov 18 2014 - 11:27:45 EET

Well that was a surprise, to see that ffmpeg has been fully removed from
Ubuntu now. Not sure how much of a better move that is, compared to the
very underhand tactics of having it a renamed package which in reality
had nothing to do with real ffmpeg. Not sure I want to get into the
politics of the situation here though, sure most of you know far more
than I do!

Anyway I have a little script for batch converting flacs to mp3s as I am
rather space conscience while travelling and my mp3 player never liked
ogg. My Bash skills are near zero and what I have working is messy from
searching on the internet for a solution. Hopefully you can help me
modify it to use Sox rather than ffmpeg. (And possibly make it so I can
simply call the command, rather than the more complex command I have to
use currently.)

To start the process I currently use this command in the terminal:
find -type d -exec ~/bin/flac2mp3 "{}" \;

The previously working contents of flac2mp3 was:
#!/bin/bash
if [ -d "${1}" ] ; then
   cd "${1}" && for f in *.flac; do ffmpeg -i "$f" -f wav - | lame -b
320 -m j -q 0 - "${f%.flac}.mp3"; done
fi

I tried quickly to edit.

#!/bin/bash
if [ -d "${1}" ] ; then
   cd "${1}" && for f in *.flac; do sox "$f" -b 16 "${f%.flac}.wav" - |
lame -b 320 -m j -q 0 - "${f%.flac}.mp3"; done
fi

Seems to think the .wav is an incoming file for concatenation.

#!/bin/bash
if [ -d "${1}" ] ; then
   cd "${1}" && for f in *.flac; do sox "$f" -b 16 "${f%.flac}.wav" |
lame -b 320 -m j -q 0 - "${f%.flac}.mp3"; done
fi

Gives me all the wav files converted but doesn't then pass them onto the
lame section of the command.

I'm sure this must be really simple! (As much having it all in one
single script called by just executing the file!)

Regards, Dale.
_______________________________________________
Linux-audio-user mailing list
Linux-audio-user@email-addr-hidden
http://lists.linuxaudio.org/listinfo/linux-audio-user
Received on Tue Nov 18 12:15:01 2014

This archive was generated by hypermail 2.1.8 : Tue Nov 18 2014 - 12:15:01 EET