forked from w3c/webcodecs
-
Notifications
You must be signed in to change notification settings - Fork 0
/
pcm_codec_registration.src.html
115 lines (94 loc) · 5.26 KB
/
pcm_codec_registration.src.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
<pre class='metadata'>
Title: Linear PCM WebCodecs Registration
Repository: w3c/webcodecs
Status: NOTE-ED
Shortname: webcodecs-pcm-codec-registration
Level: none
Group: mediawg
ED: https://w3c.github.io/webcodecs/pcm_codec_registration.html
TR: https://www.w3.org/TR/webcodecs-pcm-codec-registration/
Editor: Chris Cunningham, w3cid 114832, Google Inc. https://www.google.com/
Editor: Paul Adenot, w3cid 62410, Mozilla https://www.mozilla.org/
Editor: Bernard Aboba, w3cid 65611, Microsoft Corporation https://www.microsoft.com/
Abstract: This registration is entered into the [[webcodecs-codec-registry]].
It describes, for Linear PCM, the (1) fully qualified codec strings,
(2) the codec-specific {{EncodedAudioChunk}}
[=EncodedAudioChunk/[[internal data]]=] bytes, (3) the
{{AudioDecoderConfig.description}}, and (4) the values of
{{EncodedAudioChunk}} [=EncodedAudioChunk/[[type]]=].
Linear PCM is the [[webcodecs#audio-sample-formats|raw audio format]] used
in WebCodecs and does not require decoding. The motivation for registering
the Linear PCM codec is to enable passthrough "decoding" of PCM content as
an architectural simpliciation for WebCodecs applications.
The registration is not intended to include any information on whether a
codec format is encumbered by intellectual property claims. Implementers and
authors are advised to seek appropriate legal counsel in this matter if they
intend to implement or use a specific codec format.
This registration is non-normative.
Markup Shorthands:css no, markdown yes, dfn yes
!Participate: <a href="https://github.com/w3c/webcodecs">Git Repository.</a>
!Participate: <a href="https://github.com/w3c/webcodecs/issues/new">File an issue.</a>
!Version History: <a href="https://github.com/w3c/webcodecs/commits">https://github.com/w3c/webcodecs/commits</a>
</pre>
<pre class='anchors'>
spec: WEBCODECS; urlPrefix: https://w3c.github.io/webcodecs/#
type: attribute
text: AudioDecoderConfig.description; url: dom-audiodecoderconfig-description
type: dfn
for: EncodedAudioChunkType; text: key; url: dom-encodedaudiochunktype-key
for: EncodedAudioChunk; text: [[internal data]]; url: dom-encodedaudiochunk-internal-data-slot
for: EncodedAudioChunk; text: [[type]]; url: dom-encodedaudiochunk-type-slot
text: sample; url: sample
text: interleaved; url: interleaved
text: section on sample magnitude; url: audio-samples-magnitude
type: interface
text: EncodedAudioChunk; url: encodedaudiochunk
text: AudioData; url: audiodata-interface
type: dictionary
text: AudioDecoderConfig; url: dictdef-audiodecoderconfig
text: AudioEncoderConfig; url: dictdef-audioencoderconfig
type: enum
text: AudioSampleFormat; url: enumdef-audiosampleformat
text: u8; url: dom-audiosampleformat-u8
text: s16; url: dom-audiosampleformat-s16
text: s24; url: dom-audiosampleformat-s24
text: s32; url: dom-audiosampleformat-s32
text: f32; url: dom-audiosampleformat-f32
</pre>
Fully qualified codec strings {#fully-qualified-codec-strings}
==============================================================
This codec's string begins with the prefix "pcm-", followed by a suffix that
indicates the sample format. The complete list of strings and associated
formats is as follows.
* pcm-u8, using format {{u8}}
* pcm-s16, using format {{s16}}
* pcm-s24, using three [[WEBIDL#idl-octet|byte]] (24-bit) [=samples=] with
[=interleaved=] [[webcodecs#audio-buffer-arrangement|channel arrangement]].
* pcm-s32, using format {{s32}}
* pcm-f32, using format {{f32}}
NOTE: [[WEBCODECS]] does not define a 24-bit {{AudioSampleFormat}}. 24-bit
samples are permitted within an {{EncodedAudioChunk}}, but such samples will
be "decoded" in {{AudioData}} objects as either {{s32}} of {{f32}}. Please
see [[WEBCODECS]] [=section on sample magnitude=] for addtional details.
EncodedAudioChunk data {#encodedaudiochunk-data}
================================================
Linear pulse code modulation (linear PCM) describes a format where the audio
values are sampled at a regular interval, and where the quantization levels
between two successive values are linearly uniform.
{{EncodedAudioChunk}} [=EncodedAudioChunk/[[internal data]]=] is expected to be
a sequence of bytes of arbitrary length, with a [=sample=] occuring every N
bits, where N is defined by the codec string. For multichannel PCM, [=samples=]
from different channels are [=interleaved=].
AudioDecoderConfig description {#audiodecoderconfig-description}
================================================================
An {{AudioDecoderConfig.description}} is expected to be omitted from the
{{AudioDecoderConfig}}.
EncodedAudioChunk type {#encodedaudiochunk-type}
================================================
The [=EncodedAudioChunk/[[type]]=] for an {{EncodedAudioChunk}} containing
Linear PCM is always "[=EncodedAudioChunkType/key=]".
Privacy and Security Considerations {#privacy-and-security-considerations}
==========================================================================
Please refer to the [[WEBCODECS#privacy-considerations|Privacy Considerations]]
and [[WEBCODECS#security-considerations|Security Considerations]] sections in
[[WEBCODECS]].