File format:wav

From sigrok
Revision as of 04:27, 2 August 2014 by Bert (talk | contribs)
Jump to navigation Jump to search
wav
Name Waveform audio
Status supported
Source code (in) wav.c
Source code (out) wav.c
Common extension(s) .wav
MIME type audio/vnd.wave
ASCII format no
Compression none
Website wikipedia.org

wav is a binary file format generally used for storing audio data.

Format

See Wikipedia, or one of many other resources for a file format overview.

Properties

  • The maximum file size is limited to 4GB (uint32_t used for the file size header field). However, many applications routinely ignore this field, and just load however many samples are in the file.
  • While sigrok stores the analog values in a WAV file as they are, many audio applications that process WAV files cannot deal with sample values outside the range -1 to +1. Thus when generating a WAV file with sigrok with a view to using an audio application on that file, it is recommended to scale down the values to within the audio range.

Implementation

Both input and output of WAV files is supported in sigrok. The input module can take sample values in PCM (8, 16 and 32 bits) and 32-bit IEEE754 BINARY32 floating point.

Output to WAV files is always in 32-bit IEEE754 BINARY32 floating point.

WAV files are always assumed to be little-endian, and conversion to/from the files is done on that assumption.

The output module has an option scale. When specified, this divides the sample values by the given factor. This can be used when the resulting WAV file is intended for processing by an audio tool, which generally expects samples to be in the range -1 to +1.

Examples

Resources