wav.c File Reference

#include <math.h>
#include <stdio.h>
#include <ctype.h>
#include <stdlib.h>
#include <unistd.h>
#include <time.h>
#include <string.h>
#include <assert.h>
#include <sys/types.h>
#include <netinet/in.h>
#include "common.h"

Include dependency graph for wav.c:

Go to the source code of this file.

Functions

FILE * OpenWavChannel (int channel)
 open an wav file for output
void CloseWavFile (int channel)
 end a WAV channel file The wav header is updated according to the previous information structure
void AbortWavFile (int channel)
 cancel a SAC channel file
void AddWavData (int channel)
 process one channel

Variables

FILE * wavChannelFile [MAX_CHANNEL]
char wavChannelFileName [MAX_CHANNEL][128]
int32_t Vmin [MAX_CHANNEL]
int32_t Vmax [MAX_CHANNEL]
int64_t Vavg [MAX_CHANNEL]


Function Documentation

void AbortWavFile ( int  channel  ) 

cancel a SAC channel file

Parameters:
channel the channel to cancel

Definition at line 211 of file wav.c.

References PrintDebug, wavChannelFile, and wavChannelFileName.

void AddWavData ( int  channel  ) 

process one channel

Definition at line 223 of file wav.c.

References HWConfigType::data, HWConfig, infoHeader, InfoHeaderType::npts, Titan2SRType::npts, OpenWavChannel(), HWConfigType::srExp, HWConfigType::srObs, Vavg, Vmax, Vmin, and wavChannelFile.

Referenced by EndSuperFrame().

Here is the call graph for this function:

void CloseWavFile ( int  channel  ) 

end a WAV channel file The wav header is updated according to the previous information structure

Parameters:
channel the channel to close

Definition at line 88 of file wav.c.

References Titan2SRType::base, FileName(), fileNameOptions, infoHeader, noWrite, InfoHeaderType::npts, PrintError, PrintLog, Rename(), InfoHeaderType::sr, UpdateInfoHeader(), Vavg, Vmax, Vmin, wavChannelFile, and wavChannelFileName.

Referenced by FlushDataFiles().

Here is the call graph for this function:

FILE* OpenWavChannel ( int  channel  ) 

open an wav file for output

Parameters:
channel the channel number
Returns:
the correponding FILE* pointer, NULL on error

Definition at line 52 of file wav.c.

References FILE_BUFFER_SIZE, InitInfoHeader(), OpenTempFile(), PrintError, Vavg, Vmax, Vmin, wavChannelFile, and wavChannelFileName.

Referenced by AddWavData().

Here is the call graph for this function:


Variable Documentation

int64_t Vavg[MAX_CHANNEL]

Definition at line 47 of file wav.c.

Referenced by AddWavData(), CloseWavFile(), and OpenWavChannel().

int32_t Vmax[MAX_CHANNEL]

Definition at line 46 of file wav.c.

Referenced by AddWavData(), CloseWavFile(), and OpenWavChannel().

int32_t Vmin[MAX_CHANNEL]

Definition at line 46 of file wav.c.

Referenced by AddWavData(), CloseWavFile(), and OpenWavChannel().

FILE* wavChannelFile[MAX_CHANNEL]

Initial value:

 {
        NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,
        NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,
        NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,
        NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,
        NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,
}

Definition at line 37 of file wav.c.

Referenced by AbortWavFile(), AddWavData(), CloseWavFile(), and OpenWavChannel().

char wavChannelFileName[MAX_CHANNEL][128]

Definition at line 44 of file wav.c.

Referenced by AbortWavFile(), CloseWavFile(), and OpenWavChannel().


Generated on Tue Jul 22 23:11:57 2008 for Titan2Reader by  doxygen 1.5.6