You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Feb 21, 2026. It is now read-only.
When calculating the duration with the wavDuration() method, the size used is Parser.Size. In Parser.Parse() this is set to be the RIFF chunkSize, i.e. the file size - 8 bytes. This means that the header chunks are included in the calculation, giving a duration that is too long. The size that should be used is the size from the data chunk.
In most cases the added duration will be small enough that you won't notice, but if you need to know the exact number of samples in the file, or you have a file with large amounts of meta data in the headers (which you could typically get with BWF and derivatives), it becomes a problem.
When calculating the duration with the wavDuration() method, the size used is
Parser.Size. InParser.Parse()this is set to be theRIFFchunkSize, i.e. the file size - 8 bytes. This means that the header chunks are included in the calculation, giving a duration that is too long. The size that should be used is the size from thedatachunk.In most cases the added duration will be small enough that you won't notice, but if you need to know the exact number of samples in the file, or you have a file with large amounts of meta data in the headers (which you could typically get with BWF and derivatives), it becomes a problem.