Difference between revisions of "SoX native intermediate format"

From MultimediaWiki
Jump to navigation Jump to search
 
(file format)
Line 4: Line 4:
  
 
[[SoX]] has LGPL muxer and demuxer.
 
[[SoX]] has LGPL muxer and demuxer.
 +
 +
== File format ==
 +
 +
Depending on the magic number, all fields are written in big or little endian, including the double-precision floating-point sample rate.  Audio is always stored in 32-bit linear PCM, with endianness also determined by the file's magic number.
 +
 +
  Bytes    Type      Description
 +
 
 +
  0- 3    string    Magic number (".SoX" for LE, "XoS." for BE)
 +
  4- 7    int32    Size of headers in bytes
 +
  8-15    int64    Number of samples
 +
  16-23    double    Sample rate
 +
  24-27    int32    Number of channels
 +
  28-31    int32    Size of comment in bytes
 +
  32-..    string    Comment
 +
  ..-..              Padding
 +
  ..-end  int32    Audio samples
 +
 +
Number of channels may be between 1 and 65535, inclusive.
 +
 +
Total header size must be a multiple of 8 bytes; it equals size of the fixed header (without the magic number - 28 bytes) plus size of comment plus size of padding (which is reserved for possible future use).
  
 
[[Category:Container Formats]]
 
[[Category:Container Formats]]
 
[[Category:Formats missing in FFmpeg]]
 
[[Category:Formats missing in FFmpeg]]

Revision as of 13:41, 27 May 2009

  • Extension: sox

Uncompressed PCM format used in SoX.

SoX has LGPL muxer and demuxer.

File format

Depending on the magic number, all fields are written in big or little endian, including the double-precision floating-point sample rate. Audio is always stored in 32-bit linear PCM, with endianness also determined by the file's magic number.

 Bytes    Type      Description
 
  0- 3    string    Magic number (".SoX" for LE, "XoS." for BE)
  4- 7    int32     Size of headers in bytes
  8-15    int64     Number of samples
 16-23    double    Sample rate
 24-27    int32     Number of channels
 28-31    int32     Size of comment in bytes
 32-..    string    Comment
 ..-..              Padding
 ..-end   int32     Audio samples

Number of channels may be between 1 and 65535, inclusive.

Total header size must be a multiple of 8 bytes; it equals size of the fixed header (without the magic number - 28 bytes) plus size of comment plus size of padding (which is reserved for possible future use).