[Stk] FileRead - large WAV - fileSize_ wrong
Stephane Kyles
stephane at ciant.cz
Thu Oct 14 03:23:11 PDT 2010
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 ?
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://ccrma-mail.stanford.edu/pipermail/stk/attachments/20101014/7888baa5/attachment.html
More information about the Stk
mailing list