Skip to content

Commit

Permalink
Fixing description of sub format GUID bytes
Browse files Browse the repository at this point in the history
The previous description incorrectly implied the 2 byte format tag
comes after the other 14 bytes, instead of before.
  • Loading branch information
jstrait committed May 12, 2023
1 parent 02c3d08 commit 16c9647
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion how_wave_files_work.html
Original file line number Diff line number Diff line change
Expand Up @@ -407,7 +407,7 @@ <h2>Extra Format Fields for EXTENSIBLE format</h2>
<p>The GUID for any format tag can be determined by plugging the 4 digit hex representation of the format code into the GUID template <code>0000____-0000-0010-8000-00aa00389b71</code>. For example, the format tag for A-law format is <code>6</code> in decimal, which is <code>0x0006</code> as a 4 digit hex number. Therefore the GUID for this format is <code>0000<span class="inline-code-highlight">0006</span>-0000-0010-8000-00aa00389b71</code>.</p>
<p>However, it&rsquo;s also possible to use WAVE_FORMAT_EXTENSIBLE for other formats that don&rsquo;t have a format tag defined. This allows new formats to be defined without having to coordinate with Microsoft to reserve a format tag. In that situation the GUID won&rsquo;t match the template above.</p>
<p>The GUID&rsquo;s bytes are not stored in an order that matches the text representation. Each byte (i.e. every two hex digits) of the first three groups is stored in reverse order from the text format, unlike the final two groups. For example, the GUID <code>00000001-0000-0010-8000-00aa00389b71</code> is stored as the bytes <code>0x01</code> <code>0x00</code> <code>0x00</code> <code>0x00</code> <code>0x00</code> <code>0x00</code> <code>0x10</code> <code>0x00</code> <code>0x80</code> <code>0x00</code> <code>0x00</code> <code>0xaa</code> <code>0x00</code> <code>0x38</code> <code>0x9b</code> <code>0x71</code>.</p>
<p>This means that the bytes of an existing format tag&rsquo;s GUID can be determined by appending the two byte format tag to the bytes <code>0x00</code> <code>0x00</code> <code>0x00</code> <code>0x00</code> <code>0x10</code> <code>0x00</code> <code>0x80</code> <code>0x00</code> <code>0x00</code> <code>0xaa</code> <code>0x00</code> <code>0x38</code> <code>0x9b</code> <code>0x71</code>.</p>
<p>This means that the bytes of an existing format tag&rsquo;s GUID can be determined by taking the two bytes of the original format tag and appending <code>0x00</code> <code>0x00</code> <code>0x00</code> <code>0x00</code> <code>0x10</code> <code>0x00</code> <code>0x80</code> <code>0x00</code> <code>0x00</code> <code>0xaa</code> <code>0x00</code> <code>0x38</code> <code>0x9b</code> <code>0x71</code>.</p>

<h2>The Fact Chunk</h2>
<div class="scroll-x">
Expand Down

0 comments on commit 16c9647

Please sign in to comment.