Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Add TODO tasks for wave format compliance

  • Loading branch information...
commit 6a4f21fc5b9761013cc9fcfd4d8c7282f2f34a52 1 parent bd947de
Uranium235 authored
Showing with 4 additions and 0 deletions.
  1. +4 −0 WavFile.php
View
4 WavFile.php
@@ -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);
Please sign in to comment.
Something went wrong with that request. Please try again.