Merge pull request #26 from iluvcapra/feature-man7

wavinfo(7) Improvements
This commit is contained in:
Jamie Hardt
2023-11-08 21:43:34 -08:00
committed by GitHub

View File

@@ -16,7 +16,7 @@ divided into segments or
which a client parser can either read or skip without reading. Chunks have which a client parser can either read or skip without reading. Chunks have
an identifier, or signature: a four-character-code that tells a client what an identifier, or signature: a four-character-code that tells a client what
kind of chunk it is, and a length. Based on this information, a client can look kind of chunk it is, and a length. Based on this information, a client can look
at the identifier and decide if it knows how to read that chunk and if it wants at the identifier and decide if it knows how to read a chunk and if it wants
to. If it doesn't, it can simply read the length and skip past it. to. If it doesn't, it can simply read the length and skip past it.
.PP .PP
Some chunks are mandated by the Microsoft standard, specifically Some chunks are mandated by the Microsoft standard, specifically
@@ -33,11 +33,11 @@ Chunks can also nest inside other chunks, a special identifier
.I LIST .I LIST
is used to indicate these. A WAVE file is a recursive list: a top level is used to indicate these. A WAVE file is a recursive list: a top level
list of chunks, where chunks may contain a list of chunks themselves. list of chunks, where chunks may contain a list of chunks themselves.
.SS Order of Metadata Chunks in a WAVE File .SS Order and Arrangement of Metadata Chunks in a WAVE File
.PP .PP
Chunks in a WAVE file can appear in any order, and a capable parser can Chunks in a WAVE file can appear in any order, and a capable parser can accept
accept them appearing in any order, however authorities give guidance on them appearing in any order. However, authorities give guidance on where chunks
where chunks should be placed, when creating a new WAVE file. should be placed when creating a new WAVE file.
.PP .PP
.IP 1) .IP 1)
For all new WAVE files, clients should always place an empty chunk, a For all new WAVE files, clients should always place an empty chunk, a
@@ -53,7 +53,7 @@ without having to re-write the file or audio data.
.IP 2) .IP 2)
Older authorites recommend placing metadata before the audio data, so clients Older authorites recommend placing metadata before the audio data, so clients
reading the file sequentially will hit it before having to seek through the reading the file sequentially will hit it before having to seek through the
audio. This may improve metadata read performance on certain architecures. audio. This may improve metadata read performance on certain architectures.
.IP 3) .IP 3)
Older authorities also recommend inserting Older authorities also recommend inserting
.I JUNK .I JUNK
@@ -61,11 +61,11 @@ before the
.I data .I data
chunk, sized so that the first byte of the chunk, sized 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
factor of the page boundaries of many operating systems and architectures. This the page boundaries of many operating systems and architectures. This may
may optimize the audio I/O performance in certain situations. optimize the audio I/O performance in certain situations.
.IP 4) .IP 4)
Modern implemenations (we're looking at Modern implementations (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
@@ -149,16 +149,16 @@ chunk, which encodes a country, language, dialect and codepage along with a
time range text note. We have never seen the text field on one of these time range text note. We have never seen the text field on one of these
filled-out either. filled-out either.
.PP .PP
Some clients in our experience simply write UTF-8 into Some clients, in our experience, simply write UTF-8 into
.IR cue , .IR cue ,
.IR labl , .IR labl ,
and and
.I note .I note
fields without any kind of framing. fields without any kind of framing.
.PP .PP
The practical solution at this time is to assume either ISO Latin 1, Windows A practical solution is to assume either ISO Latin 1, Windows CP 859 or Windows
CP 859 or Windows CP 1252, and allow the client or user to override this based CP 1252, and allow the client or user to override this based on its own
on its own inferences. The inferences. The
.I chardet .I chardet
python package may provide useable guesses for text encoding, YMMV. python package may provide useable guesses for text encoding, YMMV.
.SH CHUNK MENAGERIE .SH CHUNK MENAGERIE