w3c / w3c/webcodecs

No convenient way of rebasing AudioData timestamp

Open
#505 5 comments 3 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

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

Description

audioData.timestamp is immutable, by design. There is however no convenient way of creating a new AudioData object with a different timestamp. Currently, users have to copy out data (plane by plane) and pass in the same sampleRate, numberofFrames, numberOfChannels parameters.

This issue tracks a proposal to add a new AudioData constructor, which mirrors VideoFrame's "copy constructor".

interface AudioData {
  constructor(AudioData audioData, AudioDataCopyInit init)
  [...]
}

AudioDataCopyInit {
  required long long timestamp;  // microseconds
}

The new constructor would copy all the data and metadata from the passed in audioData, and replace the original timestamp with the one passed in the AudioDataCopyInit.

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 by reviewing the AudioData constructor and the existing VideoFrame copy-constructor pattern described in the issue. Determine how the proposed AudioDataCopyInit should preserve data and metadata while replacing only the timestamp. Done means the proposal is specified consistently with the existing WebCodecs API.

Written by the indexing model from the issue text.

Assessment

Tech stack
html
Domain
api, audio-video-rtc
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
30/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.