[H-GEN] Resampling MP3's

Harry Phillips harry at tux.com.au
Thu Sep 29 22:27:07 EDT 2005


On Fri, 2005-09-30 at 11:30 +1000, Geoff Shang wrote:
> 
> Note that at 64kbps, you'll either need to downmix to mono or reduce the 
> sampling rate.
> 

No idea what that means, sorry.

> Examples to leave them as stereo (lame will reduce the sampling rate 
> automatically, to 24kHz I think):
> 
> MP3: lame --mp3input -b 64 <infile> <outfile>
> Ogg Vorbis: oggdec --quiet -o - <infile> |lame -b 64 - <outfile>
> 

Thank you for that, I forgot to mention that I need to do it in a batch
so I created a script and that some of the original file names have a
space in them.

-- ogg2mp3 start --
#!/bin/sh

DECODER=/usr/bin/oggdec
ENCODER=/usr/bin/lame
RENAME=/usr/bin/rename

$RENAME 'y/\ /_/' *

for file in *.ogg
do
	$DECODER --quiet -o - $file | $ENCODER -b 64 - ~/music/$1/$file
done

$RENAME 'y/_/\ /' *
$RENAME 's/ogg/mp3/' ~/music/$1/*.ogg

-- ogg2mp3 end --

That resamples the OGG's to MP3's using "24kHz 64kbps j-stereo", the
quality isn't great but it is good enough for when I am walking around
or riding my bike listening on the headphones they supplied with the
phone.

I just turned my phone into the MP3 player with the most battery life :)

-- 
Regards,
Harry Phillips





More information about the General mailing list