Looks good to me.
Using the following struct for the header-----------------------------------

typedef unsigned long FOURCC;

        /* these are 4 byte ASCII clumps */
#define RIFF 'FFIR'         /* file type id */
#define WAVE 'EVAW'         /* ya id */
#define FMT  ' tmf'         /* ya id */
#define DATA 'atad'         /* ya id */

typedef struct _whead       /* the .wav file header */
{
    FOURCC riff;    /* file type RIFF */        
    word flen;      /* length of following stuff in bytes */
    FOURCC wave;    /* formtype WAVE */

    FOURCC fmt;     /* ckID: 'fmt ' */
    word cksize;    /* size of fmt chunk */
    short ftag;     /* format tag (1) */
    short nchan;    /* number of channels */
    word srate;     /* sample rate in Hz */
    word avgbps;    /* average bytes/second */
    short blalign;  /* block align (1?) */
    short bits;     /* bits per sample */

    FOURCC datat;   /* ckID: 'DATA' */
    word dlen;      /* size of data chunk */
} WHEAD;

I get the 
following------------------------------------------------------------------------

C:\AWAV>awav  48k_cw10108

awav - .wav file analyser - Richard C. Allen - Nov 12 2005 15:23:17

                           file  : 48k_cw10108.wav (35136048 bytes)
                           RIFF  : RIFF
   file length includin' header  : 35136040
                           WAVE  : WAVE
                            FMT  : fmt
              format chunk size  : 16
                 format tag (1)  : 1
             number of channels  : 2
              sample rate in Hz  : 48000
           average bytes/second  : 192000
               block align (1?)  : 4
                bits per sample  : 16
                       DATA tag  : data
          length of sample data  : 35136004
              length in seconds  : 183.00

C:\AWAV>

Regards,
Richard W5SXD

>----- ------- Original Message ------- -----
>From: [EMAIL PROTECTED]
>To: FlexRadio@flex-radio.biz
>Sent: Sat, 12 Nov 2005 22:39:02
>
>Hi,
>
>I do not own an SDR-1000 but had been looking at
>the powerSDR sources
>(thanks to Flexradio for making it GPL). I also
>downloaded the wav
>files available at the flex-radio website to make
>my own receiver on
>my GNU/Linux system with GNU Radio. As an
>intermediate solution for my
>testing, I thought of using the WAV files from
>flexradio and so
>started writing a wav file reader with gnuradio. I
>could play them
>file with Rocky on WindowsXP on my office machine.
>But when I tried
>looking at the headers of the wav files using ghex2
>(a hex editor
>program available under GNU/Linux), it seems like
>they are incorrect.
>I tried just playing it with a normal WAV player
>just to verify the
>sanity of the WAV files but it refuxes to play, so
>I did some more
>stuff with Python. See below:
>
>radio:~/Desktop/files$ python
>Python 2.3.5 (#2, Aug 30 2005, 15:50:26)
>[GCC 4.0.2 20050821 (prerelease) (Debian 4.0.1-6)]
>on linux2
>Type "help", "copyright", "credits" or "license"
>for more information.
>>>> import wave
>>>> fp =
>wave.open("IK3MAC_CQ_high_noise_12-5-2004_12_46_44_
>AM.wav")
>Traceback (most recent call last):
>  File "<stdin>", line 1, in ?
>  File "/usr/lib/python2.3/wave.py", line 483, in
>open
>    return Wave_read(f)
>  File "/usr/lib/python2.3/wave.py", line 162, in
>__init__
>    self.initfp(f)
>  File "/usr/lib/python2.3/wave.py", line 143, in
>initfp
>    self._read_fmt_chunk(chunk)
>  File "/usr/lib/python2.3/wave.py", line 264, in
>_read_fmt_chunk
>    raise Error, 'unknown format: ' + `wFormatTag`
>wave.Error: unknown format: 3
>>>>
>
>It looks like the WAV file headers (some of the
>values atleast) is
>hosed. The 4th byte to 8th byte (counting from 0)
>is supposed to show
>the length of the file - 8, but it shows a
>completely different value
>when opened using a hex editor.
>
>May be this is a bug (not so serious anyway..) but
>may be I am
>completely wrong. This mail is just to let you guys
>know about this
>issue that I am seeing.
>
>I haven't looked at the relevant powerSDR source
>files to verify my claim.
>
>73
>--
>  Ramakrishnan  VU3RDD
>
>_______________________________________________
>FlexRadio mailing list
>FlexRadio@flex-radio.biz
>http://mail.flex-radio.biz/mailman/listinfo/flexrad
>io_flex-radio.biz

Reply via email to