/***************************************************************************
* NAME: wav.h
*----------------------------------------------------------------------------
* Copyright (c) coolfire.
*----------------------------------------------------------------------------
data: 6/30/07
*--------------------------------------------------------------------------*/
#include "wav.h"
/*
Byte data[4096];
Uint32 datalen;
Uint32 filelen;
riff_struct *riff_data;
fmt_struct *fmt_data;
wav_struct *wav_data;
wav(Uchar *src)
{
int fb,Len;
FILE *fp;
Byte len;
fb = open(src, O_RDWR);
Len=read(fb,riff_data,12);
Len=read(fb,fmt_data,24);
Len=read(fb,wav_data,8);
filelen=lseek(fb,54,SEEK_SET);
printf("filelen=%d\n",filelen);
datalen=lseek(fb,0,SEEK_END)-filelen;
printf("datalen=%d\n",datalen);
Len=lseek(fb,44,SEEK_SET);
Len=read(fb,data,datalen);
return WAV_OK;
}
int main()
{
FILE *fp;
wav("/root/ha.wav");
if((fp=fopen("ha.c","wb"))==NULL)
return 0;
fwrite(data,sizeof(Byte),2000,fp);
fclose(fp);
return 0;
}
*/