1

I am trying to understand the meaning of "rate" as it applies to ALSA. It is always reported in units of Hz, and is often expanded in text as "sample rate". However, usage seems to indicate that it is actually frame rate or, possibly, byte rate of an audio stream.

The confusion may arise from what exactly is referred to by "sample". If each channel is sampling at a particular frequency, then that is the frame rate of the overall stream.

So, for example, if I have a rate of 44100 Hz on a 3-channel, 16-bit audio stream, am I processing 44,100 bytes per second, 88,200 bytes per second (44,100 samples per second), or 264,600 bytes per second (44,100 frames per second)?

Question rather related to [1] and [2], and was probably the motive behind [3].
Elaboration of ALSA's meaning of "frame" and "sample" at Introduction to Sound Programming with ALSA.

Community
  • 1
  • 1
wyrm
  • 318
  • 1
  • 12

1 Answers1

2

In ALSA, the rate is the frame rate.

Historically, this value is called "sample rate" because it is the rate at which samples arrive at each DAC. This view is correct only if each channel has its own DAC. Nowadays, most DAC chips have at least two channels, so the actual sample rate does not really occur anywhere in the system.

CL.
  • 173,858
  • 17
  • 217
  • 259
  • It's worth pointing out that the definition of a frame in this context is 'n samples of audio that are present concurrently and sychronously at n output channels'. Be aware that 'frame' is used to refer to a complete frame video, or a unit of data at the input of an audio codec (whose output is a serious of audio frames, presented sequentially). It's easy to see why confusion arises. – marko Jul 01 '15 at 23:00