Skip to content

Commit

Permalink
FLAC codec registration
Browse files Browse the repository at this point in the history
  • Loading branch information
padenot committed Aug 5, 2021
1 parent 4825665 commit 85ab5c4
Show file tree
Hide file tree
Showing 4 changed files with 107 additions and 1 deletion.
5 changes: 5 additions & 0 deletions .github/workflows/auto-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,11 @@ jobs:
echidna_token: ECHIDNA_TOKEN_VORBIS_REGISTRATION
build_override: |
status: NOTE-WD
- source: flac_codec_registration.src.html
destination: flac_codec_registration.html
echidna_token: ECHIDNA_TOKEN_FLAC_REGISTRATION
build_override: |
status: NOTE-WD
steps:
# See doc at https://github.com/actions/checkout#checkout-v2
- name: Checkout repository
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
avc_codec_registration.html
codec_registry.html
vorbis_codec_registration.html
flac_codec_registration.src.html
/index.html
out/

2 changes: 1 addition & 1 deletion codec_registry.src.html
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@
<tr>
<td>flac</td>
<td>Flac</td>
<td>TODO (AudioDecoderConfig.description)</td>
<td>[FLAC codec registration](https://www.w3.org/TR/webcodecs-flac-codec-registration/) [[WEBCODECS-FLAC-CODEC-REGISTRATION]]</td>
</tr>
<tr>
<td>mp3</td>
Expand Down
100 changes: 100 additions & 0 deletions flac_codec_registration.src.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,100 @@
<pre class='metadata'>
Title: FLAC WebCodecs Registration
Repository: w3c/webcodecs
Status: NOTE-ED
Shortname: webcodecs-flac-codec-registration
Level: none
Group: mediawg
ED: https://w3c.github.io/webcodecs/flac_codec_registration.html
TR: https://www.w3.org/TR/webcodecs-flac-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 FLAC, the (1) fully qualified codec strings, (2)
the {{AudioDecoderConfig.description}} bytes, (3) the codec-specific
{{EncodedAudioChunk}} [=EncodedAudioChunk/[[internal data]]=] bytes, and (4)
the values of {{EncodedAudioChunk}} [=EncodedAudioChunk/[[type]]=].

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. Implementers of
WebCodecs are not required to support the FLAC codec.

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
text: AudioDecoderConfig.sampleRate; url: dom-audiodecoderconfig-samplerate
text: AudioDecoderConfig.channelCount; url: dom-audiodecoderconfig-channelcount
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
type: interface
text: EncodedAudioChunk; url: encodedaudiochunk
type: dictionary
text: AudioDecoderConfig; url: dictdef-audiodecoderconfig
</pre>

<pre class='biblio'>
{
"FLAC": {
"href": "https://xiph.org/flac/format.html",
"title": "FLAC - format",
"publisher": "Xiph.Org Foundation"
}
}
</pre>

Fully qualified codec strings {#fully-qualified-codec-strings}
==============================================================

The codec string is `"flac"`.

EncodedAudioChunk data {#encodedaudiochunk-data}
================================================

{{EncodedAudioChunk}} [=EncodedAudioChunk/[[internal data]]=] is expected to be
a "FRAME" as described in [[FLAC]].

AudioDecoderConfig description {#audiodecoderconfig-description}
================================================================

{{AudioDecoderConfig.description}} is required, and has to be the following:

- The bytes `0x66 0x4C 0x61 0x43` ("`fLaC`" in ASCII)
- A `METADATA_BLOCK` of type `STEAMINFO`as described in [[FLAC]]
- Optionaly other `METADATA_BLOCK`, that are not used by the specification

The {{AudioDecoderConfig.sampleRate}} and {{AudioDecoderConfig.channelCount}}
members are overridden by what the decoder finds in the
{{AudioDecoderConfig.description}}.

NOTE: This corresponds to the

EncodedAudioChunk type {#encodedaudiochunk-type}
================================================

The [=EncodedAudioChunk/[[type]]=] for an {{EncodedAudioChunk}} containing
FLAC is always "[=EncodedAudioChunkType/key=]".

NOTE: Once the initialization has succeeded, any FLAC packet can be decoded at
any time without error, but this might not result in the expected audio output.

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]].

0 comments on commit 85ab5c4

Please sign in to comment.