w3c / w3c/webcodecs

Rounding direction for `AudioData.duration`

Open
#726 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
HTML
Stars
1.3k
Forks
194
Avg merge
1d 13h
Merged PRs (30d)
3

Description

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.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the referenced WebCodecs specification section for AudioData.duration and compare its wording with the Chromium implementation mentioned in the issue. Clarify whether the conversion rounds, floors, or ceils, then update the specification so the behavior is explicit and verify the resulting wording against the implementation.

Written by the indexing model from the issue text.

Assessment

Tech stack
html
Domain
api, audio-video-rtc
Issue type
Documentation
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.