frame rate vs sample rate

Viewing the Java Code javax.sound.sampled.AudioFormat.java line 252:

frameSize 

    ((sampleSizeInBits + 7) / 8) * channels

When is Different to http://soundfile.sapp.org/doc/WaveFormat/

BlockAlign == NumChannels * BitsPerSample/8

I can't understand Why use + 7.


From: http://www.jsresources.org/faq_audio.html#frame_rate

For PCM, A-law and μ-law data, a frame is all data that belongs to one sampling intervall. This means that the frame rate is the same as the sample rate.

For compressed formats like Ogg Vorbis, mp3 and GSM 06.10, the situation is different. A frame is a block of data as it is output by the encoder. Often, these blocks contain the information for several sampling intervalls. For instance, a mp3 frame represents about 24 ms. So the frame rate is about 40 Hz. However, the sample rate of the original is preserved even inside the frames and is correctly restored after decoding.


read the documentation

Sample rate = number of samples / second

Frame = 1 sample from each channel (PCM)

Frame Size = Sample size * Channels

Frame Rate = frames / second.

For PCM the sample rate and the frame rate are the same since a frame consists of a a sample from each channel