Search notes:

Script: mp3-prep

#!/bin/bash

if [[ "$#" < 2 ]]; then
  echo "mp3-prep mp3-file out-prefix"
  exit -1
fi

if ! command -v mp3splt; then
     echo "mp3-splt not found"
     exit 1
fi

if ! command -v mp3info; then
     echo "mp3info not found"
     exit 1
fi

mp3_file=$1
out_prefix=$2

if [[ ! -e "$mp3_file" ]]; then
  echo "$mp3_file" is not a file
  exit -1
fi

if [[ -e "$out_prefix" ]]; then
  echo "Directory $out_prefix already exists"
  exit -1
fi

mkdir $out_prefix
mv "$mp3_file" $out_prefix
cd $out_prefix

duration_minutes=$(mp3info -p "%m" "$mp3_file")
# echo duration_minutes: $duration_minutes

nof_splits=$(( ( $duration_minutes + 3 ) / 5 ))
# echo nof_splits: $nof_splits

mp3splt -f -S $nof_splits -o ${out_prefix}_@n "$mp3_file"

if command -v id3convert ; then
#
# Remove mp3 tags:
#
  id3convert -s ${out_prefix}_*.mp3
fi
Github repository scripts-and-utilities, path: /mp3-prep

See also

Scripts

Index

Fatal error: Uncaught PDOException: SQLSTATE[HY000]: General error: 8 attempt to write a readonly database in /home/httpd/vhosts/renenyffenegger.ch/php/web-request-database.php:78 Stack trace: #0 /home/httpd/vhosts/renenyffenegger.ch/php/web-request-database.php(78): PDOStatement->execute(Array) #1 /home/httpd/vhosts/renenyffenegger.ch/php/web-request-database.php(30): insert_webrequest_('/notes/developm...', 1759390776, '216.73.216.42', 'Mozilla/5.0 App...', NULL) #2 /home/httpd/vhosts/renenyffenegger.ch/httpsdocs/notes/development/tools/scripts/personal/mp3-prep(85): insert_webrequest() #3 {main} thrown in /home/httpd/vhosts/renenyffenegger.ch/php/web-request-database.php on line 78