ron.savage has asked for the
wisdom of the Perl Monks concerning the following question:

Hi Folks
What's with *.wav files on an audio cd? Each one is almost exactly 4 times the size on disk. I created the audio cd with audacity, but files with real names on disk are called 'Track $N.wav' on cd.
Is there a formula I can use to convert the on-cd size to the on-disk size, so as to work out exactly which files of my 1938 are on each cd?
TIA.
Ron

Audio CDs
Audio CDs do not use WAV as their sound format, using instead Red Book audio. The commonality is that both audio CDs and WAV files have the audio data encoded in PCM. WAV is a data file format for a computer to use that cannot be understood by CD players directly. To record WAV files to an Audio CD the file headers must be stripped and the remaining PCM data written directly to the disc as individual tracks with zero-padding added to match the CD's sector size. In order for a WAV file to be able to be burned to a CD with most burners it should be in the 44100 Hz, 16-bit stereo format.

So there are no WAV files on your CD, but whether that warrants a 1-in-4 difference in size I do not know.

Perhaps there are more appropriate forums to ask this question, which does not really has much Perl content?

CountZero

A program should be light and agile, its subroutines connected like a string of pearls. The spirit and intent of the program should be retained throughout. There should be neither too little or too much, neither needless loops nor useless variables, neither lack of structure nor overwhelming rigidity." - The Tao of Programming, 4.1 - Geoffrey James

Hi Folks
$many x $thanx to all who replied. I understand the problem better now.
And yes, Perl will be used to help me clean up the recordings...
As for which format to record in, the real question is which formats can my playback devices handle? We'll see.
Cheers
Ron

Hi Folks What's with *.wav files on an audio cd? Each one is almost exactly 4 times the size on disk. I created the audio cd with audacity, but files with real names on disk are called 'Track $N.wav' on cd. Is there a formula I can use to convert the on-cd size to the on-disk size, so as to work out exactly which files of my 1938 are on each cd? TIA. Ron

This all from memory (dang accurate)

Music CDs, aka "red book" format, don't have WAV files, and yes, the track sizes are ~three times bigger , but they overlap --- built-in-raid-like-scratch-resistance

So if your cd-reader/file-explorer shows you wav files, you must remember there are no wav files , and this is a bug in the cd-reader/file-explorer, its not accounting for the red-book format

If it is possible to account for red-book, if there is a formula, the CD FAQ would have it

Anyway, why not create images/.iso?

Or why not use http://cdexos.sourceforge.net/ since it will rip/convert, and tag your files with data from CDDB (and name them using CDDB data), just like Audio::CD - Perl interface to libcdaudio (cd + cddb)

I'm not sure, but cdexos may also know how to get cddb data and rename your wave files, in case you already copied all your disks (eeek), and the files are grouped by disk

I seem to remember somewhere that CD sound-files were designed to be “bigger,” so that if the player happens to encounter a bum track, it can skip to the next one and play it, instead, without you noticing. So, the format deliberately uses a “big, fat, long” waveform instead of a “tight, compact, space-efficient” one. This lets manufacturers use “factory seconds” for publication instead of throwing them away. (To this day, you see CD-R factory seconds being sold as “music” CDs. Every now and then, misinformed people – my mother, for instance – will use them for backups. Oops...)

Instead of thinking in terms of on-cd size, I would concentrate on determining the total time in seconds and then get the total number of minutes involved. An audio cd can only
record a certain number of minutes, (somewhere between 70+ to 84?). I tried getting the metadata and seconds using
Audio::Scan and
Audio::Wav::Read.

Ada Lovelace for the palindrome
Albert Einstein for having smelly feet
Alfred Nobel for his contribution to battlefield science
Burkhard Heim for providing the missing link between science and mysticism
Claude Shannnon for riding a unicycle at night at MIT
Donald Knuth for being such a great organist
Edward Teller for being the template for Dr. Strangelove
Edwin Hubble for pretending to be a pipe-smoking English gentleman
Erwin Schrödinger for cruelty to cats
Hedy Lamarr for weaponizing pianos
Hugh Everett for immortality, especially for cats
Isaac Newton for his occult studies
Kikunae Ikeda for discovering the secrets of soy sauce
Larry Wall for his website
Louis Camille Maillard for discovering why steaks taste good
Marie Curie for the shiny stuff
Nikola Tesla for the cool cars
Paul Dirac for speaking one word per hour when socializing
Richard Feynman for his bongo skills
Robert Oppenheimer for his in-depth knowledge of the Bhagavad Gita
Rusi P Taleyarkhan for Cold Fusion
Sigmund Freud for his Ménage ā trois
Theodor W Adorno for his contribution to the reception of jazz
Wilhelm Röntgen for the foundations of body scanners
Yulii Borisovich Khariton for the Tsar Bomba
Other (please explain why)