|
16 | 16 | (2) the codec-specific {{EncodedAudioChunk}}
|
17 | 17 | [=EncodedAudioChunk/[[internal data]]=] bytes, (3) the
|
18 | 18 | {{AudioDecoderConfig.description}} bytes, and (4) the values of
|
19 |
| - {{EncodedAudioChunk}} [=EncodedAudioChunk/[[type]]=]. |
| 19 | + {{EncodedAudioChunk}} [=EncodedAudioChunk/[[type]]=], and (5) the |
| 20 | + codec-specific extensions to {{AudioEncoderConfig}}. |
20 | 21 |
|
21 | 22 | The registration is not intended to include any information on whether a
|
22 | 23 | codec format is encumbered by intellectual property claims. Implementers and
|
|
46 | 47 | text: EncodedAudioChunk; url: encodedaudiochunk
|
47 | 48 | type: dictionary
|
48 | 49 | text: AudioDecoderConfig; url: dictdef-audiodecoderconfig
|
| 50 | + text: AudioEncoderConfig; url: dictdef-audioencoderconfig |
49 | 51 | </pre>
|
50 | 52 |
|
51 | 53 | <pre class='biblio'>
|
52 | 54 | {
|
53 | 55 | "FLAC": {
|
54 |
| - "href": "https://xiph.org/flac/format.html", |
55 |
| - "title": "FLAC - format", |
56 |
| - "publisher": "Xiph.Org Foundation" |
| 56 | + "href": "https://datatracker.ietf.org/doc/draft-ietf-cellar-flac", |
| 57 | + "title": "Free Lossless Audio Codec", |
| 58 | + "publisher": "IETF" |
57 | 59 | }
|
58 | 60 | }
|
59 | 61 | </pre>
|
|
75 | 77 | {{AudioDecoderConfig.description}} is required, and has to be the following:
|
76 | 78 |
|
77 | 79 | - The bytes `0x66 0x4C 0x61 0x43` ("`fLaC`" in ASCII)
|
78 |
| -- A `METADATA_BLOCK` of type `STEAMINFO` as described in [[FLAC]] |
79 |
| -- Optionaly other `METADATA_BLOCK`, that are not used by the specification |
| 80 | +- A `metadata block` (called the STREAMINFO block) as described in section 7 of [[FLAC]] |
| 81 | +- Optionaly other metadata blocks, that are not used by the specification |
80 | 82 |
|
81 | 83 | The {{AudioDecoderConfig.sampleRate}} and {{AudioDecoderConfig.numberOfChannels}}
|
82 | 84 | members are overridden by what the decoder finds in the
|
|
94 | 96 | NOTE: Once the initialization has succeeded, any FLAC packet can be decoded at
|
95 | 97 | any time without error, but this might not result in the expected audio output.
|
96 | 98 |
|
| 99 | +AudioEncoderConfig extensions {#audioencoderconfig-extensions} |
| 100 | +============================================================= |
| 101 | + |
| 102 | +<pre class='idl'> |
| 103 | +<xmp> |
| 104 | +partial dictionary AudioEncoderConfig { |
| 105 | + FlacEncoderConfig flac; |
| 106 | +}; |
| 107 | +</xmp> |
| 108 | +</pre> |
| 109 | + |
| 110 | +<dl> |
| 111 | + <dt><dfn dict-member for=AudioEncoderConfig>flac</dfn></dt> |
| 112 | + <dd> |
| 113 | + Contains codec specific configuration options for the FLAC codec. |
| 114 | + </dd> |
| 115 | +</dl> |
| 116 | + |
| 117 | + |
| 118 | +FlacEncoderConfig {#flac-encoder-config} |
| 119 | +-------------------------------------- |
| 120 | + |
| 121 | +<pre class='idl'> |
| 122 | +<xmp> |
| 123 | +dictionary FlacEncoderConfig { |
| 124 | + [EnforceRange] unsigned long blockSize = 0; |
| 125 | + [EnforceRange] unsigned long compressLevel = 5; |
| 126 | +}; |
| 127 | +</xmp> |
| 128 | +</pre> |
| 129 | + |
| 130 | +To check if an {{FlacEncoderConfig}} is valid, run these steps: |
| 131 | +1. If {{FlacEncoderConfig/blockSize}} is not a valid block size, |
| 132 | + which is described section 5.1 of [[FLAC]], return `false`. |
| 133 | +1. If {{FlacEncoderConfig/compressLevel}} is specified and not within the range of |
| 134 | + `0` (fastest, least compression) and `8` (slowest, most compression) inclusively, return `false`. |
| 135 | +2. Return `true`. |
| 136 | + |
| 137 | +<dl> |
| 138 | + <dt><dfn dict-member for=FlacEncoderConfig>blockSize</dfn></dt> |
| 139 | + <dd> |
| 140 | + Configures the number of samples to use per frame, of output {{EncodedAudioChunk}}s. |
| 141 | + |
| 142 | + NOTE: Use 0 to let the encoder estimate a blocksize by default. |
| 143 | + </dd> |
| 144 | + |
| 145 | + <dt><dfn dict-member for=FlacEncoderConfig>compressLevel</dfn></dt> |
| 146 | + <dd> |
| 147 | + Configures the compression level to use while encoding. |
| 148 | + </dd> |
| 149 | + |
| 150 | +</dl> |
| 151 | + |
97 | 152 | Privacy Considerations {#privacy-considerations}
|
98 | 153 | ==========================================================================
|
99 | 154 |
|
|
0 commit comments