faster: a bashpodder plugin

I’ve been asked to supply the script that I use to speed up podcasts. So here it is:

#!/bin/bash
# v0.3 20080919 https://kenfallon.com
if [ -d "${*}" ]; then
  cd "${*}"
  ls -1 2>/dev/null | while read FILE;do
    FILENAME=${FILE##*/}
    sox "${FILENAME}" "${FILENAME}-faster.ogg" -V9 tempo 1.5
    if [ "$?" != "0" ]; then
      faad -o - "${FILENAME}" | lame - - | sox -t mp3 - "${FILENAME}"-faster.ogg -V9 tempo 1.5
    fi
    rm "${FILENAME}"
  done
fi

The script will change to a directory if one is given and then will try to speed up all the files in that directory. If the sox program fails to process the file then the faad program will try to convert it to mp3 using lame. This will then be piped to sox again to speed it up and convert it to an ogg file.

Yes I know this is not fantastic and it will also try and speed up text files or anything else that is in the directory. However this is supposed to be used as a plugin to bashpodder. It seems everything has a plugin architecture so why should bashpodder be left out. The plugin aspect is achieved by adding this line to the end of the bashpodder script.

if [ "`basename ${0}`" = "bp" ];then fast ${datadir};fi

The idea is that you can still run bashpodder normally you just call bashpodder.shell as normal. To use the script you can call it with bp. That is nothing more than a symbolic linc to bashpodder.shell

ln -s bashpodder.shell bp
This entry was posted in Podcasts and tagged , , , , . Bookmark the permalink.

2 Responses to faster: a bashpodder plugin

  1. Pingback: HPR ep0481 :: Mashpodder « kenfallon.com

  2. Pingback: SpudShow « kenfallon.com

Leave a Reply

Your email address will not be published. Required fields are marked *