Skip to content

Add example usage with WebCodecs AudioDecoder or VideoDecoder? #22

@JohnWeisz

Description

@JohnWeisz

Hi, thanks for your work on this great library, it's working perfect for parsing audio files.

Do you have an example about how to use it with the WebCodecs API to decode frames? My use case is decoding an audio file into raw LPCM samples. In particular, what's not clear to me:

  • How do duration and totalDuration of a CodecFrame correlate to the timestamp and duration of an EncodedAudioChunk?
  • How to determine if a CodecFrame is a keyframe?
  • Is it the CodecFrame.data array that you pass as the data to EncodedAudioChunk? Do you pass it as-is or by copying only the portion the Uint8Array view references?

Thanks in advance, I'll add a reply if I figure it out myself in the meantime.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions