home *** CD-ROM | disk | FTP | other *** search
/ rtsi.com / 2014.01.www.rtsi.com.tar / www.rtsi.com / OS9 / MM1 / SOUNDUTILS / audioplay.lzh / AUDIOPLAY / SRC / audio_filehdr.h next >
Text File  |  1995-02-20  |  2KB  |  51 lines

  1. /*    @(#)audio_filehdr.h 1.1 89/12/22 SMI    */
  2. /* Copyright (c) 1989 by Sun Microsystems, Inc. */
  3.  
  4. #ifndef _multimedia_audio_filehdr_h
  5. #define    _multimedia_audio_filehdr_h
  6.  
  7. /* #include "archdep.h" */
  8.  
  9. /*
  10.  * Define an on-disk audio file header.
  11.  *
  12.  * This structure should not be arbitrarily imposed over a stream of bytes,
  13.  * since the byte orders could be wrong.
  14.  *
  15.  * Note that there is an 'info' field that immediately follows this
  16.  * structure in the file.
  17.  *
  18.  * The hdr_size field is problematic in the general case because the
  19.  * field is really "data location", which does not ensure that all
  20.  * the bytes between the header and the data are really 'info'.
  21.  * Further, there are no absolute guarantees that the 'info' is ASCII text,
  22.  * (non-ASCII info may eventually be far more useful anyway).
  23.  *
  24.  * When audio files are passed through pipes, the 'data_size' field may
  25.  * not be known in advance.  In such cases, the 'data_size' should be
  26.  * set to AUDIO_UNKNOWN_SIZE.
  27.  */
  28. typedef struct {
  29.     u_int32        magic;        /* magic number */
  30.     u_int32        hdr_size;    /* size of this header */
  31.     u_int32        data_size;    /* length of data (optional) */
  32.     u_int32        encoding;    /* data encoding format */
  33.     u_int32        sample_rate;    /* samples per second */
  34.     u_int32        channels;    /* number of interleaved channels */
  35. } Audio_filehdr;
  36.  
  37.  
  38. /* Define the magic number */
  39. #define    AUDIO_FILE_MAGIC        ((u_int32)0x2e736e64)
  40.  
  41. /* Define the encoding fields */
  42. #define    AUDIO_FILE_ENCODING_MULAW_8    (1)    /* 8-bit ISDN u-law */
  43. #define    AUDIO_FILE_ENCODING_LINEAR_8    (2)    /* 8-bit linear PCM */
  44. #define    AUDIO_FILE_ENCODING_LINEAR_16    (3)    /* 16-bit linear PCM */
  45. #define    AUDIO_FILE_ENCODING_LINEAR_24    (4)    /* 24-bit linear PCM */
  46. #define    AUDIO_FILE_ENCODING_LINEAR_32    (5)    /* 32-bit linear PCM */
  47. #define    AUDIO_FILE_ENCODING_FLOAT    (6)    /* 32-bit IEEE floating point */
  48. #define    AUDIO_FILE_ENCODING_DOUBLE    (7)    /* 64-bit IEEE floating point */
  49.  
  50. #endif /*!_multimedia_audio_filehdr_h*/
  51.