Skip to content

Instantly share code, notes, and snippets.

@intijk
Created April 3, 2012 16:06

Revisions

  1. intijk revised this gist Aug 21, 2012. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion convmp3
    Original file line number Diff line number Diff line change
    @@ -8,7 +8,7 @@ do
    outTmpFile=`cat /dev/urandom | sed 's/[^a-zA-Z0-9]//g' | strings -n 5 | head -n 1`.mp3
    ln -s "$1" $inTmpFile
    outputFile=`echo $1 | perl -pe 's|(.*\.).*?$|\1mp3|'`
    ffmpeg -i "$inTmpFile" "$outTmpFile"
    ffmpeg -i "$inTmpFile" -id3v2_version 3 "$outTmpFile"
    mv "$outTmpFile" "$outputFile"
    rm "$outTmpFile" "$inTmpFile"
    shift
  2. intijk created this gist Apr 3, 2012.
    15 changes: 15 additions & 0 deletions convmp3
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,15 @@
    #!/bin/bash
    #Usage example: ./convmp3 *.wma
    while [ ! $# -eq 0 ]
    do
    affix=`echo $1|perl -pe 's|(.*)(\..*?)$|\2|'`
    echo $affix
    inTmpFile=`cat /dev/urandom | strings -n 5 | head -n 1`$affix
    outTmpFile=`cat /dev/urandom | sed 's/[^a-zA-Z0-9]//g' | strings -n 5 | head -n 1`.mp3
    ln -s "$1" $inTmpFile
    outputFile=`echo $1 | perl -pe 's|(.*\.).*?$|\1mp3|'`
    ffmpeg -i "$inTmpFile" "$outTmpFile"
    mv "$outTmpFile" "$outputFile"
    rm "$outTmpFile" "$inTmpFile"
    shift
    done