www.pudn.com > vmix_1.013.zip > WAVETYPE.H


#ifndef _WAVE_TYPE_H 
#define _WAVE_TYPE_H 
 
 
typedef unsigned char byte; 
 
    typedef struct { 
        char *fname;        // file name 
        char huge *ptr;     // pointer to the buffer 
        long len;           // file length 
        int  han;           // registered handle 
        long sr;            // sample rate 
        int  ch;            // channels 
        int  sz;            // data size (8 or 16) 
        int  cp;            // compression 
    } wave; 
 
// 4. Wave format control block 
 
    typedef struct { 
        int  formatTag;     // format category 
        int  nChannels;     // stereo/mono 
        long nSamplesPerSec;    // sample rate 
        long nAvgBytesPerSec;   // stereo * sample rate 
        int  nBlockAlign;       // block alignment (1=byte) 
        int  nBitsPerSample;    // # byte bits per sample 
    } WaveInfo; 
 
// 3. Wave detailed information Block 
 
    typedef struct { 
        char name[4];   // "fmt " 
        long length; 
        WaveInfo info; 
    } WaveFormat; 
 
// 3. Data header which follows a WaveFormat Block 
 
    typedef struct { 
        char name[4];   // "data" 
        unsigned long length; 
    } DataHeader; 
 
// 2. Total Wave Header data in a wave file 
 
    typedef struct { 
        char name[4];   // "WAVE" 
        WaveFormat fmt; 
        DataHeader data; 
    } WaveHeader; 
 
// 2. Riff wrapper around the WaveFormat Block (optional) 
 
    typedef struct { 
        char name[4];   // "RIFF" 
        long length; 
    } RiffHeader; 
 
// 1. Riff wrapped WaveFormat Block 
 
    typedef struct { 
        RiffHeader riff; 
        WaveHeader wave; 
    } RiffWave; 
 
// 0. A sound effect for mixing output 
 
    typedef struct { 
        char huge *ptr; 
        int  valid; 
        int  repeat; 
        long len; 
        long pos; 
    } Sound; 
 
#endif