Skip to content

AnalyserNode::getFloatTimeDomainData() doesn't specify the encoding of the waveform #25571

@djee-ms

Description

@djee-ms

MDN URL

https://developer.mozilla.org/en-US/docs/Web/API/AnalyserNode/getFloatTimeDomainData

What specific section or headline is this issue about?

Top-level description

What information was incorrect, unhelpful, or incomplete?

Missing encoding of the waveform. Because the parameter is a Float32Array, one can reasonably assume that the encoding is f32 (that is, PCM data amplitude in [-1:1]). However it would be better to confirm this in writing instead of leaving developers to their guess. There's also no mention of planar/non-planar encoding, which is necessary to do anything with the data retrieved (unless the signal has a single channel).

What did you expect to see?

Something akin to:

The time-domain data is encoded in `f32` format with the amplitude of samples in [-1:1].

Do you have any supporting links, references, or citations?

No response

Do you have anything more you want to share?

The 3 other instance methods of AnalyzerNode have the same issue. Especially for the byte variant where it's unclear if the data is signed [-128:127] or unsigned [0:255]. The example in https://developer.mozilla.org/en-US/docs/Web/API/AnalyserNode/getByteTimeDomainData hints that it may be the former.

MDN metadata

Page report details

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions