A WAV file is built out of chunks, and every chunk starts with a four-byte ASCII tag that names it. Today you read those four bytes back as text, the smallest possible first step into the format.
Read four bytes and return them as a four-character ASCII string.
The WAV format is a specific use of a general container called RIFF (Resource
Interchange File Format). A RIFF file is a sequence of chunks, and every chunk
begins with a four-character code - four raw ASCII bytes that name what the
chunk is. RIFF, WAVE, fmt , and data are the ones you will meet first.
These tags are stored as plain bytes, big-endian in the sense that byte order is
just reading order - the first byte is the first character. Note that fmt is
four characters including a trailing space (0x20); the format is strict about
the count, so the space is real and required. Today is deliberately tiny: turn four
bytes into a string. Every chunk you parse from here on starts exactly this way.
// a chunk id is just four ASCII bytes, read in orderfunc readID(b []byte) string {return string(b[0:4])}