@pcthugDec 13.2006 — #Well I search around for a while and couldn't find anything, so I ended up putting this together. It will return a 2 decimal float value in seconds. [code=php] /* float getWavFilesize ( string file )
*/ function getWavFilesize($file) { if (strtoupper(pathinfo($file, PATHINFO_EXTENSION)) !== 'WAV') { trigger_error('File is not a Wav File.'); return false; } elseif (!$bin = @file_get_contents($file)) { trigger_error('File either does not exist or is not readable.'); return false; }
@pcthugDec 14.2006 — #Here is an updated version. It is more scalable as it does not have defined SubChunkSize's.[code=php] /* float getWavFilesize ( string file )
*/ function getWavFilesize($file) { if (strtoupper(pathinfo($file, PATHINFO_EXTENSION)) !== 'WAV') { trigger_error('File is not a Wav File.'); return false; } elseif (!$bin = @file_get_contents($file)) { trigger_error('File either does not exist or is not readable.'); return false; }