最新消息:20210816 当前crifan.com域名已被污染,为防止失联,请关注(页面右下角的)公众号

ALSA中的术语:帧

工作和技术 crifan 2086浏览 0评论

Alsa中的术语:帧

一个采样就是一个值,代表了在某一特定时刻的音频信号的幅度,每个声道都有一个采样。而当我们谈论数字音频的时候,我们常常说的是,可以表示所有声道的在某一时刻所有数据,这些其实就是一堆采样(sample)的组合,其中每个声道对应一个采样,也就是我们所说的 。(解释:也就是说,对于单声道来说,一个帧就是 单个声道对应的一个采样;对于双声道来说,就是两个声道全部的采样,其中如果alsa声卡以interleaved的模式存放数据的时候,就是先一个左声道的采样,跟着一个右声道的采样;如果是其他,比如5.1声道的立体声的话,除了左右声道的采样,应该还有其他空间某些位置的数据,好像是正中和左后、右后对应的采样,这些采样数据的组合,叫做一个 帧 )。。。。

Terminology

capture
Receiving data from the outside world (different from "recording" which implies storing that data somewhere, and is not part of ALSA’s API)

playback
Delivering data to the outside world, presumably, though not necessarily, so that it can be heard.

duplex
A situation where capture and playback are occuring on the same interface at the same time.

xrun
Once the audio interface starts running, it continues to do until told to stop. It will be generating data for computer to use and/or sending data from the computer to the outside world. For various reasons, your program may not keep up with it. For playback, this can lead to a situation where the interface needs new data from the computer, but it isn’t there, forcing it use old data left in the hardware buffer. This is called an "underrun". For capture, the interface may have data to deliver to the computer, but nowhere to store it, so it has to overwrite part of the hardware buffer that contains data the computer has not received. This is called an "overrun". For simplicity, we use the generic term "xrun" to refer to either of these conditions

PCM
Pulse Code Modulation. This phrase (and acronym) describes one method of representing an analog signal in digital form. Its the method used by almost computer audio interfaces, and it is used in the ALSA API as a shorthand for "audio".

channel
frame
A sample is a single value that describes the amplitude of the audio signal at a single point in time, on a single channel. When we talk about working with digital audio, we often want to talk about the data that represents all channels at a single point in time. This is a collection of samples, one per channel, and is generally called a "frame". When we talk about the passage of time in terms of frames, its roughly equivalent to what people when they measure in terms of samples, but is more accurate; more importantly, when we’re talking about the amount of data needed to represent all the channels at a point in time, its the only unit that makes sense. Almost every ALSA Audio API function uses frames as its unit of measurement for data quantities.

interleaved
a data layout arrangement where the samples of each channel that will be played at the same time follow each other sequentially. See "non-interleaved"

non-interleaved
a data layout where the samples for a single channel follow each other sequentially; samples for another channel are either in another buffer or another part of this buffer. Contrast with "interleaved"

sample clock
a timing source that is used to mark the times at which a sample should be delivered and/or received to/from the outside world. Some audio interfaces allow you to use an external sample clock, either a "word clock" signal (typically used in many studios), or "autosync" which uses a clock signal present in incoming digital data. All audio interfaces have at least one sample clock source that is present on the interface itself, typically a small crystal clock. Some interfaces do not allow the rate of the clock to be varied, and some have clocks that do not actually run at precisely the rates you would expect (44.1kHz, etc). No two sample clocks can ever be expected to run at precisely the same rate – if you need two sample streams to remain synchronized with each other, they MUST be run from the same sample clock.

转载请注明:在路上 » ALSA中的术语:帧

发表我的评论
取消评论

表情

Hi,您需要填写昵称和邮箱!

  • 昵称 (必填)
  • 邮箱 (必填)
  • 网址
79 queries in 0.176 seconds, using 22.10MB memory