Convert MP3 to OGG and vice versa

Here's some code to convert and entire dir of .ogg files to .mp3

ls *.ogg -1 | while read file; do ogg123 -d wav "$file" -f /dev/stdout | lame - "/tmp/$file.mp3"; done; The reverse .mp3 to .ogg files ls *.mp3 -1 | while read file; do mpg123 "$file" --wav /dev/stdout | oggenc /dev/stdin -o /tmp/"$file".ogg; done; Before you flame me, yes I know this is a lossy conversion but sometimes it has to be done. For example my cell phone will only play .mp3 files so I had to do some conversions.


Note: Replies will be formatted with PHP Markdown Extra syntax.

Name: Email (Not Required):
 
Logged IP: 3.149.250.19
To prevent spam please submit by clicking the kitten: