Correct the format of *.wav header

git-svn-id: svn+ssh://svn.code.sf.net/p/wsjt/wsjt/branches/wsjtx@2714 ab8295b8-cf94-4d9e-aec4-7959e3be5d79
This commit is contained in:
Joe Taylor 2012-11-02 14:18:01 +00:00
parent ed8a9ebb18
commit e4c78f090b
3 changed files with 18 additions and 18 deletions

Binary file not shown.

View File

@ -31,19 +31,19 @@ void getfile(QString fname, int ntrperiod)
void savewav(QString fname, int ntrperiod) void savewav(QString fname, int ntrperiod)
{ {
struct { struct {
char ariff[4]; char ariff[4]; //ChunkID: "RIFF"
int nchunk; int nchunk; //ChunkSize: 36+SubChunk2Size
char awave[4]; char awave[4]; //Format: "WAVE"
char afmt[4]; char afmt[4]; //Subchunk1ID: "fmt "
int lenfmt; int lenfmt; //Subchunk1Size: 16
short int nfmt2; short int nfmt2; //AudioFormat: 1
short int nchan2; short int nchan2; //NumChannels: 1
int nsamrate; int nsamrate; //SampleRate: 12000
int nbytesec; int nbytesec; //ByteRate: SampleRate*NumChannels*BitsPerSample/8
short int nbytesam2; short int nbytesam2; //BlockAlign: NumChannels*BitsPerSample/8
short int nbitsam2; short int nbitsam2; //BitsPerSample: 16
char adata[4]; char adata[4]; //Subchunk2ID: "data"
int ndata; int ndata; //Subchunk2Size: numSamples*NumChannels*BitsPerSample/8
} hdr; } hdr;
int npts=ntrperiod*12000; int npts=ntrperiod*12000;
@ -58,11 +58,11 @@ void savewav(QString fname, int ntrperiod)
hdr.ariff[1]='I'; hdr.ariff[1]='I';
hdr.ariff[2]='F'; hdr.ariff[2]='F';
hdr.ariff[3]='F'; hdr.ariff[3]='F';
hdr.nchunk=0; hdr.nchunk=36 + 2*npts;
hdr.awave[0]='W'; hdr.awave[0]='W';
hdr.awave[0]='A'; hdr.awave[1]='A';
hdr.awave[0]='V'; hdr.awave[2]='V';
hdr.awave[0]='E'; hdr.awave[3]='E';
hdr.afmt[0]='f'; hdr.afmt[0]='f';
hdr.afmt[1]='m'; hdr.afmt[1]='m';
hdr.afmt[2]='t'; hdr.afmt[2]='t';

View File

@ -1,4 +1,4 @@
//------------------------------------------------------------- MainWindow //-------------------------------------------------------------- MainWindow
#include "mainwindow.h" #include "mainwindow.h"
#include "ui_mainwindow.h" #include "ui_mainwindow.h"
#include "devsetup.h" #include "devsetup.h"