|
||||||
| Forums FAQ | Members List | Search | Today's Posts | Mark Forums Read |
| ARCHIVES - Tips, Tricks & Tweaks Tips and Solutions for SUSE Linux
(Please do not post questions here) |
|
|
LinkBack | Thread Tools | Display Modes |
|
|||
|
A friend of mine wrote a couple of simple and fast scripts for conversion of m4a and ogg music files to mp3. Here is how you can use them.
1. we need a folder where we keep scripts and this folder should be set as a path in .bashrc . For example the folder /home/username/bin and the appropriate line in .bashrc: Code:
#Paths
PATH="/home/username/bin:${PATH}"
3. make the files executables, in terminal: Code:
chmod +x /home/username/bin/* Code:
#!/bin/sh IFS=" " while [ "$#" -gt "0" ] do ****echo converting $1 ****if file $1 | grep "MPEG v4" >/dev/null ****then ********x=`echo $1 | sed 's/\(.*\.\)m4a/\1wav/'` ********y=`echo $1 | sed 's/\(.*\.\)m4a/\1mp3/'` ********if faad -o $x $1 >/dev/null 2>&1 && lame -h $x $y >/dev/null 2>&1 ********then echo OK! ************rm $1 ************rm $x ********else echo FAILED ********fi ****else echo 'NOT an MPEG v4 file' ****fi ****echo '' ****shift done Code:
#!/bin/sh IFS=" " while [ "$#" -gt "0" ] do ****echo converting $1 ****if file $1 | grep "Ogg data" >/dev/null ****then ********x=`echo $1 | sed 's/\(.*\.\)ogg/\1wav/'` ********y=`echo $1 | sed 's/\(.*\.\)ogg/\1mp3/'` ********if oggdec -o $x $1 >/dev/null 2>&1 && lame -h $x $y >/dev/null 2>&1 ********then echo OK! ************rm $1 ************rm $x ********else echo FAILED ********fi ****else echo 'NOT an OGG file' ****fi ****echo '' ****shift done 5. now you can use the scripts to convert your files. for example if you have some ogg files in /home/username/music/ you can type: Code:
ogg2mp3.sh /home/username/music/* Please let me know if there are any typos or mistakes and let me thank Herc who wrote the scripts. Nice job Hercules! PS: the scripts are licensed under GPL
|
| Bookmarks |
| Thread Tools | |
| Display Modes | |
|
|