[Stk] FileRead - large WAV - fileSize_ wrong

Stephane Kyles stephane at ciant.cz
Thu Oct 14 03:48:46 PDT 2010


Ok I got it working (void FileRead :: read.. ) there wasn't any error there.
only this was necessary :
//fileSize_ = 8 * bytes / temp / channels_;  // give wrong size

unsigned long long DataLength = bytes ; // !

fileSize_ = 8 * DataLength / temp / channels_;  // works, reports 288000000
samples

my platform windows, vista 32 bits, visual studio 2008 sp1 if it can help.
stephane 







Hi,
I am opening the WAV file with the stk :
288000000 total samples,  48000 Hz, 16 bits, stereo.
So  100 minutes, or 1 hour and 40 minutes.

when I open the file in the stk it report a wrong number of samples : 

bool FileRead :: getWavInfo( const char *fileName )

{

. . . 

 

// Get length of data from the header.

SINT32 bytes;

if ( fread(&bytes, 4, 1, fd_) != 1 ) goto error;

#ifndef __LITTLE_ENDIAN__

  swap32((unsigned char *)&bytes);

#endif

//fileSize_ = 8 * bytes / temp / channels_;  // give wrong size

unsigned long long DataLength = bytes ; // !

      fileSize_ = 8 * DataLength / temp / channels_;  // works, reports
288000000 samples

 

. . . 

}

but afterward I get an error in :

void FileRead :: read( StkFrames& buffer, unsigned long startFrame, bool
doNormalize )

{

      if ( fread( buf, nSamples * 2, 1, fd_ ) != 1 ) // reports broken pipe
error error

      {

            goto error;

}

}

 

How to read large wav files in the stk ?

No virus found in this incoming message.
Checked by AVG - www.avg.com
Version: 9.0.862 / Virus Database: 271.1.1/3195 - Release Date: 10/13/10
20:34:00

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://ccrma-mail.stanford.edu/pipermail/stk/attachments/20101014/16511bf8/attachment.html 


More information about the Stk mailing list