Re: Review PCM Audio
- From: "Alessandro Angeli" <nobody@xxxxxxxxxxxxxxxxxx>
- Date: Sat, 21 Mar 2009 22:47:50 +0100
From: "hd"
1. "In PCM, data for .WAV files is stored using linear
samples."
Does "linear" mean the data is not compressed and samples
are stored in sequential order?
They are, but linear doesn't mean that. Liner means that the
waveform amplitude is sampled on a linear scale.
2. "Though a WAV file can hold compressed audio, the most
common WAV format contains uncompressed audio in the
linear pulse code modulation (LPCM) format...The WAV
format supports compressed audio."
Then there must be some byte(s) in the "fmt" chunk of a
WAVE file, which tell about if the audio in the "data"
chunk is compressed or linear?
The 'fmt ' chunk contains a WAVEFORMATEX structure.
3. No matter how a WAVE file stores audio data in a
digital format of either PCM, ADPCM, Mu-Law, A-Law and so
on, after it's loaded into a ds graph and when the input
pin of a transform filter in the graph showing:
Major Type: Audio
Sub Type: PCMAudio
Format: WaveFormatEx: 44.100 KHz 16 bit stereo
it means that the data stream into the filter is
uncompressed/linear PCM samples (LPCM?). Is this always
the case or any exception to this?
LPCM audio is synonym for uncompressed audio or,
uncompressed audio means audio in the LPCM format (often
referred to as just PCM). If the connection media type for a
pin shows MEDIATYPE_Audio/MEDIASUBTYPE_PCM (which is shown
as PCMAudio in GraphEdit), then that is the format of the
data flowing through that connection.
4. "Each sample is a real number with infinite resolution
in PCM and the data is truncated to either 16-bit PCM or
8-bit PCM."
Can resampling of a PCM data (e.g.16-bit or 8-bit)
directly operate on the PCM without concern of the
original real numbers from which the PCM data is
truncated?
That is the only way to operate, since it is impossible to
reconstruct the original value (which often never existed in
the first place).
5. "The number of samples per second is called sample
rate."
For 2-channel PCM, if the total number of samples (count
left-channel and right-channel separately) in a second is
8000, should the sample rate be 8KHz or 4KHz?
The sample rate is the sampling rate per channel or the
frame rate (where an LPCM frame/block contains 1 sample of
each channel). 8 KHz means you have 8000 frames/sec and, if
the stream is stereo, 16000 samples/sec. Sample can either
refer to an individual sample or to a frame but, when
talking about sample rate, it always refers to a frame.
--
// Alessandro Angeli
// MVP :: DirectShow / MediaFoundation
// mvpnews at riseoftheants dot com
// http://www.riseoftheants.com/mmx/faq.htm
.
- Prev by Date: Re: How to render subtitles in a Blue-ray graph?
- Next by Date: Re: How to render subtitles in a Blue-ray graph?
- Previous by thread: How to render subtitles in a Blue-ray graph?
- Next by thread: Heap Corruption issues with implementing DirectX Transform
- Index(es):
Relevant Pages
|