Skip to content

PCMReader returning wrong fileDurationMs on 8 bit converted audio #10

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

Open
peterdaub opened this issue May 23, 2022 · 0 comments
Open

Comments

@peterdaub
Copy link

Thanks for the library by the way, it's been super helpful!

If a file is 8bit, the PCMReader will properly convert to 16bit PCM. However, the PCMReader.getFileDurationMs method is calculating the duration based off the file size of the 8bit file but the frameSize and frameRate of the converted AudioFormat.

That method should use the encoded format instead of the decoded format to get the duration. The result is a final FFT with an incorrect number results by about half.

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