Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Wrong duration from wavDuration() #1

Open
exargon opened this issue Jan 15, 2023 · 0 comments
Open

Wrong duration from wavDuration() #1

exargon opened this issue Jan 15, 2023 · 0 comments

Comments

@exargon
Copy link

exargon commented Jan 15, 2023

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant