WAV format audio

The WAV file format is a standard for audio digital storage jointly developed by Microsoft and IBM. It adopts the RIFF file format structure, which is very close to the AIFF and IFF formats. Conforms to the PIFF Resource Interchange File Format specification. All WAVs have a file header, which is the encoding parameter of the audio stream.
Various types of data are used in multimedia applications, including bitmaps, audio data, video data, and peripheral device control information. RIFF provides a method for storing these types of data. The type of data contained in a RIFF file is identified by the extension of the file. The data that can be stored in a RIFF file includes: Audio Video Interleaved Format Data (.AVI), Waveform
Format data (.WAV), bitmap format data (.RDI), MIDI format data (.RMI), palette format (.PAL), multimedia movie (.RMN), animation cursor (.ANI), other RIFF files ( .BND).

The most basic WAVE file is in PCM (Pulse Code Modulation) format. This file directly stores the sampled sound data without any compression. It is a data format directly supported by the sound card. To make the sound card play other compressed sound data correctly, You should decompress the compressed data into PCM format first, and then let the sound card play it.

  • Structure
    1. Since the WAV format is derived from the Windows/Intel environment, it is stored in Little-Endian byte order. (java defaults big endian)
    2. The structure of RIFF files can be regarded as a tree structure, and its basic composition is a unit called "Chunk". The top is a "RIFF" block, and each block below has " Type Block Identification (Optional)", "Identifier" (4 bytes), "Data Size" (4 bytes) and "Data".
    3. The "type block identifier" is only used in some chunks, such as the "WAVE" chunk, which means that there are other chunks nested below. When the "type block identifier" is used, the chunk has no other items (such as block identifier, data size, etc.), and it is only used as an identifier when the file is read. First find this "type block identifier", and then use it as a starting point to read other chunks nested under it.
    4. Files in non-PCM format will add at least one more "fact" block, which is used to record the decompressed size of the data (note that it is data, not files). This "fact" block is usually added before the "data" block.
    5. A WAVE file is composed of several Chunks. According to the position in the file, it includes: RIFF WAVE Chunk, Format Chunk, Fact Chunk (optional), Data Chunk.

Guess you like

Origin blog.csdn.net/shuangmu9768/article/details/125145706