Permalink
Browse files

Add TODO tasks for wave format compliance

  • Loading branch information...
1 parent bd947de commit 6a4f21fc5b9761013cc9fcfd4d8c7282f2f34a52 Uranium235 committed Apr 13, 2012
Showing with 4 additions and 0 deletions.
  1. +4 −0 WavFile.php
View
@@ -474,6 +474,7 @@ public function makeHeader()
if ($subchunk1size > 16) {
$header .= pack('v', 0); // extension size = 0
}
+ // TODO: set extension fields and "fact" chunk for 24 and 32-bit - http://www-mmsp.ece.mcgill.ca/documents/audioformats/wave/wave.html
return $header;
}
@@ -1240,12 +1241,15 @@ protected function getWavInfo()
$epSize = fread($this->_fp, 2);
$extraParamsSize = unpack('vSize', $epSize);
if ($extraParamsSize['Size'] > 0) {
+ // TODO: error message for invalid extension size - maybe check extension fields if present but can be ignored
$extraParams = fread($this->_fp, $extraParamsSize['Size']);
}
$wavHeaderSize += $extraParamsSize['Size'] + 2;
}
+ // TODO: read "fact" chunk - maybe check sample length field, but can be ignored - http://www-mmsp.ece.mcgill.ca/documents/audioformats/wave/wave.html
+
$dataHeader = fread($this->_fp, 8);
$data = unpack('NSubchunk2ID/VSubchunk2Size', $dataHeader);

0 comments on commit 6a4f21f

Please sign in to comment.