-
Notifications
You must be signed in to change notification settings - Fork 34
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
Getting the exact number of frames from a stream #62
Comments
I looked into this. It seems that indeed using The reason is that the I think it's interesting that ni-media allows loading wav files which proclaim they are longer than they actually are. So I would expect some file size check to ensure the RIFF and data chunk lengths are valid and an exception if not. |
Hi There !
We're investigating how to handle loading wav files whose size - as declared in the RIFF header - is incorrect and a lot larger than the data actually contained in the file.
In such cases, we would like to crop the sound to the actual data and ideally, be able to determine the exact size without having to read the whole file upfront.
As expected,
ifstream::num_frames
will return the value read in the header.However, the documentation states:
So, we're trying to use
ifstream::frame_tellg
but it seems to return the same value asnum_frame
.Here's an example code that evaluates the number of frame using num_frames, frame_seekg and by reading the data,.
The output will be
our expectation would be that seeking would also return 98090.
Is this the api we're supposed to use ? is there another way ?
Cheers.
PS: Here's the file this test was ran with BB3_100_drum_break_paprika.zip
The text was updated successfully, but these errors were encountered: