Unoffical empeg BBS

Quick Links: Empeg FAQ | RioCar.Org | Hijack | BigDisk Builder | jEmplode | emphatic
Repairs: Repairs

Topic Options
#60136 - 17/01/2002 05:54 Using FLAC
Roger
carpal tunnel

Registered: 18/01/2000
Posts: 5680
Loc: London, UK
Well, I decided to try out FLAC this week. For those of you who missed it, FLAC (see http://flac.sourceforge.net/) is a lossless encoder (kinda like ZIP, but for WAV files).

My motivation is the fact that I'd like to start keeping an archive, so that I don't have to re-rip my CD collection every time there's a new version of LAME released.

So, I decided to try it out on my collection of Harry Potter audio CDs (read by Stephen Fry). I usually have to re-rip Harry Potter (43 CDs) every couple of months, when Mike spots that there's a glitch in one of the tracks, so this time I'm being thorough.

It's good. These are (obviously) spoken text, so you'd expect good compression, but FLAC gets the files down to about 20% of their original (WAV) size. The compression is flawless.

Random shell scripts which I found useful:

Given a directory structure like this:

/home/music/roger/Books/Harry Potter/

Philosopher's Stone/Disc 01/
01 - Chapter 1- The boy who lived.wav


$ cd /home/music/roger/Books/Harry Potter/Philosopher's Stone

$ md5sum */*.wav > MD5SUMS
$ for i in */*.wav ; do \
( grep `flac -c -d ${i%.wav}.flac | md5sum` MD5SUMS \
| grep $i || echo "Failed" ) ; done >VERIFY
$ diff MD5SUMS VERIFY


Generates MD5 checksums for the WAV files, which you can then verify against the decoded FLAC files.

Since they match, I'm going off now to delete the WAV files. Just thought I'd share this with you.
_________________________
-- roger

Top
#60137 - 17/01/2002 06:44 Re: Using FLAC [Re: Roger]
pgrzelak
carpal tunnel

Registered: 15/08/2000
Posts: 4859
Loc: New Jersey, USA
Greetings!

OK. It is the Off Topic group, so I feel justified...

Harry Potter. Read by Stephen Fry.

If you are in the US, do not, under any circumstances, settle for the US version of the audiobooks, read by Jim Dale. They are OK, but not nearly as good as the UK version. (In my humble opinion.) In case anyone hasn't noticed, I tend to be a bit, um, obsessive. I have both CD versions (US and UK), and the UK is far superior. Go the amazon.co.uk and have them ship international if you have to, but do not get the US version.

Having said this, mine are just ripped as VBRs for now. One of these days, I will re-rip / encode my collection, but that is a project for when I have a lot of time and nothing better to do.
_________________________
Paul Grzelak
200GB with 48MB RAM, Illuminated Buttons and Digital Outputs

Top
#60138 - 17/01/2002 08:23 Re: Using FLAC [Re: Roger]
DWallach
carpal tunnel

Registered: 30/04/2000
Posts: 3810
Roger, where do you store the ID3 tags for all those files? Do you use a database (as in Grip/DDJ), or some other cool hack?

Top
#60139 - 17/01/2002 09:28 Re: Using FLAC [Re: DWallach]
Roger
carpal tunnel

Registered: 18/01/2000
Posts: 5680
Loc: London, UK
They don't have any ID3 tags at the moment.

It's apparently possible to store ID3v2 tags in .flac files -- the reference decoder will skip them.

(Hmmm, wanders off to a shell prompt)

OK, this seems to work:

$ id3tag -2 -a "J.K. Rowling, read by Stephen Fry" \

-s "The boy who lived" -A "Harry Potter and the Philosopher's Stone" \
-t 01 -T 07 "01 - Chapter 1- The boy who lived.flac"
$ grep `flac -c -d "01 - Chapter 1- The boy who lived.flac" | md5sum` MD5SUMS


Shows that playback is unaffected.

$ for i in *.flac ; do \

flac -c -d $i | lame -v ${i%.flac}.mp3 ; done


Gets you the MP3 file.

$ for i in *.flac ; do \

id3cp $i ${i%.flac}.mp3 ; done


Copies the tags across -- except that there's a bug in the 3.7 version of ID3lib that makes this not work properly. It works OK with (what I think is) the 3.8.0-pre1 version.

_________________________
-- roger

Top
#60140 - 17/01/2002 10:58 Re: Using FLAC [Re: Roger]
DWallach
carpal tunnel

Registered: 30/04/2000
Posts: 3810
Sorry to harp on this, but when you rip your CDs to WAV files, where do you put the ID3 information? What set of tools do you use to do your ripping and all that?

(And, as a total aside, any hope for FLAC support on the car player? Says the FLAC FAQ: Decoding requires only integer arithmetic, and is much less compute-intensive than for most perceptual codecs. Real-time decode performance is easily achievable on even modest hardare.)

Top
#60141 - 17/01/2002 11:16 Re: Using FLAC [Re: DWallach]
Roger
carpal tunnel

Registered: 18/01/2000
Posts: 5680
Loc: London, UK
Sorry to harp on this, but when you rip your CDs to WAV files, where do you put the ID3 information??

In the filename.

What set of tools do you use to do your ripping and all that?

I rip my CDs using either cdparanoia on Linux, or EAC on Win2k. If I'm using EAC, I configure it to output WAV files, named according to: {source} - {tracknr} - {artist} - {title}.wav

If I'm using cdparanoia, I rename the files myself first.

The reason that the artist goes _after_ the source and tracknr is because I have a lot of compilation CDs. This scheme means that everything is grouped by source (album) and then sorted by track number.

I then copy the files onto the nearest Linux box and use LAME to encode them. Once they're encoded, I use a shell script to extract the ID3 information from the filename and tag the files (using the id3tag utility from id3lib).

I then organise the files into Artist\Album or Compilations or Books or Soundtracks directories. The layout matches that used on my empeg.

Then it's relatively simple to drag-and-drop the root directory to emplode to keep them synchronised.

any hope for FLAC support on the car player?

Well, the command line tools run fine on the HSX-109 (John R tried it the other day).

We'd need to look at licensing issues (libflac is LGPL, so that shouldn't be a problem). Also, we're kinda in feature-freeze for 2.0, so something this big would have to wait until after 2.0-final, probably. It also needs to be prioritised and scheduled.
_________________________
-- roger

Top
#60142 - 17/01/2002 13:55 Re: Using FLAC [Re: Roger]
tanstaafl.
carpal tunnel

Registered: 08/07/1999
Posts: 5539
Loc: Ajijic, Mexico
We'd need to look at licensing issues (libflac is LGPL, so that shouldn't be a problem). Also, we're kinda in feature-freeze for 2.0, so something this big would have to wait until after 2.0-final, probably. It also needs to be prioritised and scheduled.

This might be a worthy feature to consider. If your 5:1 compression holds true for music as well as text (unlikely, I know) and as cheap as hard drive space is today, a lossless compression option could be viable. No more worries about VBR vs CBR, Lame vs Xing, what bitrate to use, how much audio quality is being lost in the encoding, etc.

I think with my present encoding (Xing, VBR, high quality) I am probably averaging about 12:1 compression. I think I wouldn't be too upset at using three times the disk space to have lossless compression, but of course my music collection is relatively small, it currently uses only about 8 GB on my player, and at least 2 of those GB are .WAV copies of my IASCA tracks.

So, yes, I hope that you will give some "prioritise and schedule" thought to this idea.

tanstaafl.
_________________________
"There Ain't No Such Thing As A Free Lunch"

Top
#60143 - 17/01/2002 14:39 Re: Using FLAC [Re: tanstaafl.]
wfaulk
carpal tunnel

Registered: 25/12/2000
Posts: 16706
Loc: Raleigh, NC US
Unfortunately, FLAC compresses full-spectrum audio (read ``music'') by only about 3:1 to as little as about 4:3. Check out the http://flac.sourceforge.net/comparison.html]FLAC comparison page for more precise info.
_________________________
Bitt Faulk

Top
#60144 - 18/01/2002 03:01 Re: Using FLAC [Re: tanstaafl.]
rjlov
member

Registered: 16/12/1999
Posts: 188
Loc: Melbourne, Australia

But you're kind of in luck, Doug, because classical music tends to compress a lot better with flac than things with lots of noise like stuff, especially at high frequencies (e.g. drums and cymbals). I reckon you're quite likely to achieve in the region of 3:1 compression with lots of classical stuff.

Richard.

Top