开发者

What exactly is a "Sample"?

开发者 https://www.devze.com 2022-12-29 17:11 出处:网络
From the OpenAL documentation it looks like if an Sample is one single floating point value like lets say 1.94422

From the OpenAL documentation it looks like if an Sample is one single floating point value like lets say 1.94422

Is that correct? Or is a sample an array of a lot of values? What are audio programming dudes talking about when they say "Sample"? Is it the smallest possible snippet of an audio file?

I imagine an uncompressed audio file to look like a giant array with millions of floating point values, where every value is a point in a graph that forms开发者_如何学C the sound wave. So every little point is a sample?


Exactly. A sample is a value.

When you convert and analog signal to its digital representation, you convert a continuous function to a discrete and quantized one.

It means that you have a grid of vertical and horizontal lines and all the possible values lie on the intersection of the lines. The gap between vertical lines represents the distance between two consecutive samples, the gap between horizontal one is the minimum differences you may represent.

In every vertical line you have a sample, which (in linear encoding) is equal to n-times k where k is the quantum, minimum differences references above.


I imagine an uncompressed audio file to look like a giant array with millions of floating point values, where every value is a point in a graph that forms the sound wave. So every little point is a sample?

Yes, that is right. A sample is the value calculated by your A/D converter for that particular point in time. There's a sample for each channel (e.g. left and right in stereo mode. Both samples form a frame.


According to the Wikipedia article on signal processing:

A sample refers to a value or set of values at a point in time and/or space.

So yes, it could just be a single floating point value. Although as Johannes pointed out, if there are multiple channels of audio (EG: right/left), you would expect one value for each channel.


In audio programming, the term "sample" does indeed refer to a single measurement value. Among audio engineers and producers, however, the term "sample" normally refers to an entire snippet of sound taken (or sampled) from a famous song or movie or some other original audio source.

0

精彩评论

暂无评论...
验证码 换一张
取 消