I have a question about the data chunk of WAV files. We know that the chunk order in the WAV files is not fixed(i.e. data chunk is not necessarily the last chunk) and we can only assume that "fmt" chunk must appear before the "data" chunk. And WAV file header can be 44 bytes or 46 bytes or even bigger.
For the data chunk(or Subchunk 2), Subchunk2 ID(value is "data") has 4 bytes, and Subchunk 2 Size has 4 bytes. Is it safe to assume that Subchunk2 ID, Subchunk 2 Size, and Subchunk 2 Data are always ordered like this and right next to each other?
i.e. given a byte string of WAV file, is it 100% accurate to find the index of data chunk by using byte_string.find('data'.encode()), add 4 to that value to get data chunk size index, and add 8 to get the data chunk index?
For example in Python:
data_chunk_id_index = byte_string.find('data'.encode())
data_chunk_index = data_chunk_id_index + 8 # 4 bytes each for data id & data size
data_chunk_size = int.from_bytes(byte_string[data_chunk_index-4:data_chunk_index], byteorder='little')
image source: http://soundfile.sapp.org/doc/WaveFormat/
