w3c / w3c/webcodecs

What does `allocationSize` return if formats in the source and destination are null?

Open
#727 2 comments 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

It is technically possible to have a non-empty AudioData with a null [[format]], if getting an AudioData after decoding and it's not "recognized".

If output uses a recognized AudioSampleFormat, assign that format to [[format]]. Otherwise, assign null to [[format]].

If allocationSize is called on this fresh AudioData, what happens in step 5 of its algorithm?

We might be able to just return the number of bytes in the resource.

In practice, it might be the case that implementations can't hit this -- at least Gecko supports all specced audio sample formats.

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 AudioData allocationSize algorithm, especially step 5, and the cited AudioData format requirements in the WebCodecs specification. Determine the specified result when the source and destination formats are null; the issue is complete when this behavior is unambiguous in the specification.

Written by the indexing model from the issue text.

Assessment

Tech stack
html
Domain
api
Issue type
Bug
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.