Skip to main content

Notice

Please note that most of the software linked on this forum is likely to be safe to use. If you are unsure, feel free to ask in the relevant topics, or send a private message to an administrator or moderator. To help curb the problems of false positives, or in the event that you do find actual malware, you can contribute through the article linked here.
Topic: Frames (regarding CD Audio, WAV and FLAC) (Read 3709 times) previous topic - next topic
0 Members and 1 Guest are viewing this topic.

Frames (regarding CD Audio, WAV and FLAC)

Over the past several weeks I have been researching (and testing) methods of CD archival.  At present, my expectation is to use EAC to rip from my Plextor PX-W1210A to FLAC.  There are many details about which I am curious but the one this thread is about is frame sizes and what they really mean.  My impression is that many audio formats store information in frames as some way of grouping short time periods of data together.  Does anyone have a good description of this?  What are the frame sizes for CD Audio, WAV and FLAC (or does the concept not apply to them)?  If frame sizes are different between formats, does that not mean that converting from one to the other would change the length of the audio stream?

Thanks for any comments, explanations or links,
kyle

P.S.  My impression is that this effect would be minimal regardless, but since we like to nitpick about (aka, more fully understand) 30 sample offsets when ripping and burning...  this could still be reasonable.

Frames (regarding CD Audio, WAV and FLAC)

Reply #1
Frame sizes don't apply to WAV or FLAC. In fact, it really only applies to MP3, and with LAME, it has a flag to get an accurate stream length, so long as the decoder supports it. mp3_accurate_length

Frames (regarding CD Audio, WAV and FLAC)

Reply #2
CD has a "frame" as the smallest grouping of information, part of a "sector". I forgot how big it is actually. But a sector is a fixed integral multiple of a frame.

Its use is for ECC.

Frames (regarding CD Audio, WAV and FLAC)

Reply #3
CD has a "frame" as the smallest grouping of information, part of a "sector". I forgot how big it is actually.

75 frames add up to one second of audio data, so one frame holds 44100/75 = 588 samples (equals 2,352 bytes).

Frames (regarding CD Audio, WAV and FLAC)

Reply #4
so cd frames are 588 samples.  are these always full or can they be partials?

wikipedia says that .wav has a value in the header that stores the number of samples to follow, so no frame size there.

flac has a user spec'ed frame size, and from my experience it has no trouble exactly matching the original .wav file.  can anyone confirm (not from experience) that flac can handle partial final frames (or other implementation with equivalent functionality)?

thanks for the responses guys,
-kyle

Frames (regarding CD Audio, WAV and FLAC)

Reply #5
CDDA tracks must always contain a multiple of 588 samples. If not given such, !burning software will either return an error or pad it out with null samples.

FLAC is without this restriction, but has an encoding option called "--sector-align" that can make tracks compliant
Quote
Align encoding of multiple CD format files on sector boundaries. This option is only allowed when encoding files all of which have a 44.1kHz sample rate and 2 channels. With --sector-align, the encoder will align the resulting .flac streams so that their lengths are even multiples of a CD sector (1/75th of a second, or 588 samples). It does this by carrying over any partial sector at the end of each file to the next stream. The last stream will be padded to alignment with zeroes.

This option will have no effect if the files are already aligned (as is the normally the case with WAVE files ripped from a CD). flac can only align a set of files given in one invocation of flac.

WARNING: The ordering of files is important! If you give a command like 'flac --sector-align *.wav' the shell may not expand the wildcard to the order you expect. To be safe you should 'echo *.wav' first to confirm the order, or be explicit like 'flac --sector-align 8.wav 9.wav 10.wav'.


edit: recording = burning