07-18-2010, 06:43 AM
According to the WAV file specification, the "fact" chunk gives the sample length:
http://www-mmsp.ece.mcgill.ca/Documents/.../WAVE.html
length 4: Chunk ID: "fact"
length 4: Chunk size (minimum 4, it seems the PSP is using 8)
length 4: Number of Samples
This value seems to be different for files having the same length. But this chunk is not always located at the same place in the header. So the approach would be to search for the "fact" chunk and take the 32-bit "Number of Samples" following it.
Examples based on hyakki's post:
Atrac-0000C7CC-000420FF.at3 ("Number of Samples" 32-bit value at 3C)
Atrac-001DC5E4-006CD401.at3 ("Number of Samples" 32-bit value at 50)
Does this method work on CC?
http://www-mmsp.ece.mcgill.ca/Documents/.../WAVE.html
length 4: Chunk ID: "fact"
length 4: Chunk size (minimum 4, it seems the PSP is using 8)
length 4: Number of Samples
This value seems to be different for files having the same length. But this chunk is not always located at the same place in the header. So the approach would be to search for the "fact" chunk and take the 32-bit "Number of Samples" following it.
Examples based on hyakki's post:
Atrac-0000C7CC-000420FF.at3 ("Number of Samples" 32-bit value at 3C)
Atrac-001DC5E4-006CD401.at3 ("Number of Samples" 32-bit value at 50)
Does this method work on CC?