Benutzer-Werkzeuge

Webseiten-Werkzeuge


multimedia:mp3:convertaac

Unterschiede

Hier werden die Unterschiede zwischen zwei Versionen angezeigt.

Link zu dieser Vergleichsansicht

Nächste Überarbeitung
Vorhergehende Überarbeitung
multimedia:mp3:convertaac [2015/05/09 10:30] – angelegt rsimultimedia:mp3:convertaac [2015/05/09 11:27] (aktuell) rsi
Zeile 1: Zeile 1:
 == aac in mp3 konvertieren == == aac in mp3 konvertieren ==
 +=== aac_to_mp3.sh ===
 <code> <code>
 #!/bin/bash #!/bin/bash
 # #
-# Shell script for m4a to mp3 conversion+# Shell script for aac to mp3 conversion
 # #
-# The scripts reads all m4a files recursively from a directory tree +# The scripts reads all aac files recursively from a directory tree 
-# It creates the mp3 file from the m4a, and removes the m4a file+# It creates the mp3 file from the aac, and removes the aac file
 # #
 # Please run the script from the Base Directory in which your Music is stored # Please run the script from the Base Directory in which your Music is stored
Zeile 14: Zeile 14:
  
 # ------------------------------------------------------------------------------ # ------------------------------------------------------------------------------
-# function to list all m4a files into a file+# function to list all aac files into a file
 # ------------------------------------------------------------------------------ # ------------------------------------------------------------------------------
  
 list_songs(){ list_songs(){
  
-  echo "creating list of m4a files...."+  echo "creating list of aac files...."
   sleep 2   sleep 2
-  find . -type f -name *.m4a > $FILE+  find . -type f -name \*.aac > $FILE
   echo "added `wc -l $FILE` entries"   echo "added `wc -l $FILE` entries"
   echo "done."   echo "done."
Zeile 29: Zeile 29:
  
 # ------------------------------------------------------------------------------ # ------------------------------------------------------------------------------
-# function to convert a single file from m4a to mp3+# function to convert a single file from aac to mp3
 # ------------------------------------------------------------------------------ # ------------------------------------------------------------------------------
  
-m4a_to_mp3(){+aac_to_mp3(){
  
-  m4a_file="$@" # get all args +  aac_file="$@" # get all args 
-  echo "processing file $m4a_file ..."+  echo "processing file $aac_file ..."
  
-  # convert m4a file to wav +  # convert aac file to wav 
-  faad "$m4a_file"+  faad "$aac_file"
  
   # generating filenames   # generating filenames
-  wav_file=`echo "$m4a_file"|sed -e 's/.m4a/.wav/'+  wav_file=`echo "$aac_file"|sed -e 's/.aac/.wav/'
-  mp3_file=`echo "$m4a_file"|sed -e 's/.m4a/.mp3/'`+  mp3_file=`echo "$aac_file"|sed -e 's/.aac/.mp3/'`
  
   #echo "wav file: $wav_file"   #echo "wav file: $wav_file"
Zeile 48: Zeile 48:
  
   # preserve track info, lame will use it for id3 tagging   # preserve track info, lame will use it for id3 tagging
-  faad -i "$m4a_file" 2>.id3info.txt+  faad -i "$aac_file" 2>.id3info.txt
   title=`grep 'title: ' .id3info.txt|sed -e 's/title: //'`   title=`grep 'title: ' .id3info.txt|sed -e 's/title: //'`
   artist=`grep 'artist: ' .id3info.txt|sed -e 's/artist: //'`   artist=`grep 'artist: ' .id3info.txt|sed -e 's/artist: //'`
Zeile 65: Zeile 65:
   rm "$wav_file"   rm "$wav_file"
   #echo "removing $wav_file done."   #echo "removing $wav_file done."
-  rm "$m4a_file+  rm "$aac_file
-  #echo "removing $m4a_file done."+  #echo "removing $aac_file done."
  
 } }
Zeile 75: Zeile 75:
 FILE="songlist.txt" FILE="songlist.txt"
  
-# create list of m4a Files (> songlist.txt)+# create list of aac Files (> songlist.txt)
 list_songs list_songs
          
Zeile 93: Zeile 93:
 while read line while read line
 do do
-   m4a_to_mp3 $line+   aac_to_mp3 $line
 done done
 exec 0<&3 exec 0<&3
multimedia/mp3/convertaac.1431160233.txt.gz · Zuletzt geändert: von rsi

Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki