This commit is contained in:
Jamie Hardt
2023-11-08 15:42:59 -08:00
parent d7540b0a79
commit c002120c61

View File

@@ -52,9 +52,9 @@ WAVE file
without having to re-write the file or audio data. without having to re-write the file or audio data.
.IP 2) .IP 2)
Older authorites recommend placing metadata before the audio data, so Older authorites recommend placing metadata before the audio data, so
clients reading the file sequentially will hit it before having to seek clients reading the file sequentially will hit it before having to seek through
through the audio. This may have improved metadata read performance at one the audio. This may have improve metadata read performance on certain
time. architecures.
.IP 3) .IP 3)
Older authorities also recommend inserting Older authorities also recommend inserting
.I JUNK .I JUNK
@@ -63,18 +63,18 @@ before the
chunk, sized in such a way so that the first byte of the chunk, sized in such a way so that the first byte of the
.I data .I data
payload lands immediately at 0x1000 (4096), because this was a common payload lands immediately at 0x1000 (4096), because this was a common
factor of the page boundaries of many operating systems and architectures. factor of the page boundaries of many operating systems and architectures. This
This could optimize the audio I/O performance in certain situations. may optimize the audio I/O performance in certain situations.
.IP 4) .IP 4)
Modern implemenations (we're looking at Modern implemenations (we're looking at
.B Pro Tools .B Pro Tools
here) tend to place the Broadcast-WAVE here) tend to place the Broadcast-WAVE
.I bext .I bext
metadata before the data, followed by the data itself, and then other metadata before the data, followed by the data itself, and then other data
data after that. after that.
.PP .PP
Clients reading WAVE files should be tolerant and accept any configuration Clients reading WAVE files should be tolerant and accept any configuration of
of chunks, and should accept any file as long as the obligatory chunks, and should accept any file as long as the obligatory
.I fmt .I fmt
and and
.I data .I data
@@ -87,32 +87,30 @@ these chunks, in this order, and to hard-code the offsets of the short
.I fmt .I fmt
chunk and chunk and
.I data .I data
chunk into their program, and this is something that should always be chunk into their program, and this is something that should always be checked
checked when evaluating a new tool, just to make sure the developer when evaluating a new tool, just to make sure the developer didn't do this.
didn't do this. Many coding examples and WAVE file explainers from the Many coding examples and WAVE file explainers from the 90s and early aughts
90s and early aughts give the basic layout of a WAVE file and naive devs give the basic layout of a WAVE file and naive devs go along with it.
go along with it.
.SS Encoding and Decoding Text Metadata .SS Encoding and Decoding Text Metadata
.PP .PP
Modern metadata systems, anything developed since the late aughts, will Modern metadata systems, anything developed since the late aughts, will defer
defer encoding to an XML parser so when dealing with encoding to an XML parser so when dealing with
.I ixml .I ixml
or or
.I axml .I axml
so a client can mostly ignore this problem. so a client can mostly ignore this problem.
.PP .PP
The most established metadata systems are older than this though, and The most established metadata systems are older than this though, and so the
so the entire weight of text encoding history falls upon the client. entire weight of text encoding history falls upon the client.
.PP .PP
The original WAVE specification, a part of the Microsoft/IBM Multimedia The original WAVE specification, a part of the Microsoft/IBM Multimedia
interface of 1991, was written at a time when Windows was an ascendant interface of 1991, was written at a time when Windows was an ascendant and
and soon-to-be dominant desktop environment. Audio files were almost soon-to-be dominant desktop environment. Audio files were almost
never shared via LANs or the Internet or any other way. never shared via LANs or the Internet or any other way. When audio files were
When audio files were shared, among the miniscule number of people shared, among the miniscule number of people who did this, it was via BBS or
who did this, it was via BBS or usenet. Users at this time may have usenet. Users at this time may have ripped them from CDs, but the cost of hard
ripped them from CDs, but the cost of hard drives and low quality of drives and low quality of compressed formats at the time made this little more
compressed formats at the time made this little more than a curiosity. than a curiosity. There was no
There was no
.I CDBaby or .I CDBaby or
.I CDDB .I CDDB
to download and populate metadata from at this time. to download and populate metadata from at this time.
@@ -121,25 +119,25 @@ So, the
.I INFO .I INFO
and and
.I cue .I cue
metadata systems, which are by far the most prevalent and supported, metadata systems, which are by far the most prevalent and supported, were
were published two years before the so-called "Endless September" of published two years before the so-called "Endless September" of 1993 when the
1993 when the Internet became mainstream, when Unicode was still a Internet became mainstream, when Unicode was still a twinkle in the eye, and
twinkle in the eye, and two years before Ariana Grande was born. two years before Ariana Grande was born.
.PP .PP
The safest assumption, and the mandate of the Microsoft, is that all The safest assumption, and the mandate of the Microsoft, is that all text
text metadata, by default, be encoded in Windows codepage 819, metadata, by default, be encoded in Windows codepage 819, a.k.a. ISO Latin
a.k.a. ISO Latin alphabet 1, or ISO 8859-1. This covers most Western alphabet 1, or ISO 8859-1. This covers most Western European scripts but
European scripts but excludes all of Asia, Russia and most of the European excludes all of Asia, Russia and most of the European Near East, the Middle
Near East, the Middle East. East.
.SH CHUNK MENAGERIE .SH CHUNK MENAGERIE
A list of chunks that you may find in a wave file from our experience. A list of chunks that you may find in a wave file from our experience.
.SS Essential WAV Chunks .SS Essential WAV Chunks
.IP fmt .IP fmt
Defines the format of the audio in the Defines the format of the audio in the
.I data .I data
chunk: the audio codec, the sample rate, bit depth, channel count, block chunk: the audio codec, the sample rate, bit depth, channel count, block
alignment and other data. May take an "extended" form, with additional data alignment and other data. May take an "extended" form, with additional data
(such as channel speaker assignments) if there are more than two channels in (such as channel speaker assignments) if there are more than two channels in
the file or if it is a compressed format. the file or if it is a compressed format.
.IP data .IP data
The audio data itself. PCM audio data is always stored as interleaved samples. The audio data itself. PCM audio data is always stored as interleaved samples.