[nflug] Splitting large mp3 files

Joe josephj at main.nc.us
Mon Dec 29 06:51:11 EST 2008


I couldn't get that to work.  It wanted -vo instead of -o, didn't
recognize -tt, etc.   But, I did finally get mp3splt to work with the
following shell script:

#!/bin/bash
## Audiobook splitter

## Usage is audiobooksplit [-t minutes-per-part] file.mp3

NAME=$(basename $"0")
USAGE="Usage is $NAME [-t minutes-per-part] file.mp3"

LENGTH=60
if [ "$1" == "-t" ]
then
  shift
  LENGTH=$1
  shift
fi

if (( LENGTH < 1 ))
then
  echo $USAGE >&2
  exit 1
fi

if [ ! -r "${1}" ]
then
  echo "Cannot read [$1]" >&2
  exit 1
fi


IN="$1"

OUT="${IN%\.mp3}"
OUT="${OUT%\.MP3}"
mp3splt -o "${OUT} part @n.mp3" -t ${LENGTH}.00 "${IN}"

Notes:
The -o lets you control the names given to the partial files with @n
giving a three digit part number to make the file names unique.

mp3splt does a less than stellar job of filling in the id3 tags on the
new files, but at least it tries.

Joe

Corey Reichle wrote:
> Use mplayer:
>
> mplayer -i foo1.mp3 -o bar1.mp3 -s 00:00:00 -tt 00:10:00
> mplayer -i foo.mp3 -o bar2.mp3 -s 00:10:00 -tt 00:10:00
>
> Just keep doing this, or whip up a loop to do it.  mplayer does almost
> anything with almost any media.  You may need to tweak the command
> line options, but read the man for it, and it's pretty well done with
> examples.
>
> Dec 26, 2008 02:35:33 AM, nflug at nflug.org <mailto:nflug at nflug.org> wrote:
>
>     I have an audio version of a book in the form of one 11+ hour mp3
>     file.
>     This file is difficult to manage and my stand-alone player gives up
>     after about 2 hours.
>
>     I'd like to break the file into one hour chunks. How do I do that?
>
>     I tried loading it into audacity (which took 15 minutes). I figured I
>     could select one section at a time and save it to its own file. I
>     think
>     I was able to select a section, but I couldn't find any "Save
>     selection
>     to file" option.
>
>     Apparently, kubuntu hardy doesn't come with an audacity documentation
>     package,
>     so the help function doesn't work. I'm going to try to find it on
>     the web.
>
>     I found a utility called mp3split, but could not find a deb that would
>     install (found one for it, but not for its library) and could not
>     compile it from source.
>
>     Normally, I would just load the whole thing, chop it down to one
>     section
>     and save as. In this case though, that would take around 3 hours just
>     for repeated loading of the original file.
>
>     Any ideas?
>
>     TIA
>
>     Joe
>
>     _______________________________________________
>     nflug mailing list
>     nflug at nflug.org <mailto:nflug at nflug.org>
>     http://www.nflug.org/mailman/listinfo/nflug
>
> ------------------------------------------------------------------------
>
> _______________________________________________
> nflug mailing list
> nflug at nflug.org
> http://www.nflug.org/mailman/listinfo/nflug
>   



More information about the nflug mailing list