WAV File LibraryΒΆ

The WAV File library is used for reading, writing and handling the the stored WAV files.

../_images/f1e7826462d540de0a33139000bb7749

Process map

To unzip the generated WAV files, the archive function blocks of the CAA_File libraries: CAA_File LibraryFILE_ArchiveUnpack: FILE_ArchiveUnpackFM502_CMS.

Architecture

Internally the WAV File library uses the four chunk structure model of the WAV files to handle the data in the read and write operations.

To perform the correct data handling the WAV File library uses a structure internally. This structure is a group of data stored in the following order:

  • RIFF Chunk ID,
  • File Size,
  • RIFF Type,
  • Format Chunk ID,
  • Channel Information,
  • Sampling Frequency,
  • Block Align,
  • Bits per Sample,
  • Data Chunk ID,
  • Data,
  • Label Information.
../_images/75e4cec1648e01830a3313900051176b

Internal data type of the library

Read and Write WAV Files

A single READ or WRITE functionality in this library is executed in the following steps:

  1. Open the file to create the handle.

    β‡’

    Validates the file, if already present (except in Function Block CREATE).

  2. Set the pointer to the file position from where the desired READ or WRITE operation is to be executed.

  3. Assign the inputs of the function block to the internal structure.

    β‡’

    Stores the data in the proper structure before writing (in function blocks CREATE and APPEND).

  4. Perform the READ/WRITE operation.

    β‡’

    Stores the data in the proper structure after reading (in Function Blocks INFO and READ)

  5. Assign the outputs to the function block.

  6. Close the file.

With the development of the WAV-File library the user can get the following benefits:

  • Specific function blocks to perform the specific task.
  • Either a function block or the visualization can be used.
  • The function blocks internally take care of four important tasks
    • Opening the file and validating it.
    • Preparing the proper data structure at the time of reading or writing, according to the WAV file standards.
    • Performing the READ or WRITE operation.
    • Closing the file.
  • Simple to understand and execute.