-
Notifications
You must be signed in to change notification settings - Fork 129
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
Rounding direction for AudioData.duration
#726
Comments
This is a fair point; we went with an integer time representation because that was the most straightforward to guarantee round-tripping timestamps to whatever storage format an implementation is using. It's an oddball format, so we had better be making the most of it. I agree that it probably doesn't matter which way we go, both flooring and rounding should be straightforward for implementations to compute exactly. I have a slight preference for round since it is a bit more accurate, but truncation may be what people expect? |
See https://w3c.github.io/webcodecs/#ref-for-dom-audiodata-duration%E2%91%A1
Does this round or floor or ceil? If I follow Chromium's code correctly, it simply casts the
double
to an integer, resulting in a generally floored value. I think this is fine (it's bound to be losing precision anyway), but maybe we should spec it.The text was updated successfully, but these errors were encountered: