···11+# Dong Web
22+33+A PWA to read `.dong` files (see [working with dong](./work-with-dong.md) files for more info)
44+55+## Usage
66+77+do some stuff
+36
work-with-dong.md
···11+# Dong Files
22+33+Dong files are image files that play audio when opened. The mime type is `application/prs.vielle.dong`
44+55+## Creating a `.dong` file
66+77+A dong file is structured as follows:
88+99+```txt
1010+d0<version>
1111+<image-mime><image-data>
1212+<audio-mime><audio-data>
1313+<image-data>
1414+<audio-data>
1515+```
1616+1717+### Version
1818+1919+Version is an 8 bit number that indicates the version of the dong file. This file documents version 2 of the dong file format. This is prefixed with the hex value d0 to indicate that this is a dong file. The first 16 bits of a version 2 `.dong` file should be `11010000 00000010`. If this does not match, it is either a different file format or version.
2020+2121+### Image Metadata
2222+2323+Image metadata starts with a mimetype. The mimetype is 255 bytes long, followed by a 00 byte. If the mimetype is shorter than 255 characters, the remaining bytes are filled with 00 bytes.
2424+The metadata is then followed with an image length, which must be 32 bits long. This represents the number of bytes in the image data.
2525+2626+### Audio Metadata
2727+2828+See: Image metadata
2929+3030+### Image Data
3131+3232+This is a binary blob taking up the number of bytes allocated in image-length.
3333+3434+### Audio Data
3535+3636+This is a binary blob taking up the number of bytes allocated in audio-length.