Skip to content

Conversation

Josh-Cena
Copy link
Member

Fix #25571. Wondering if you could advise @padenot—thanks!

@Josh-Cena Josh-Cena requested a review from a team as a code owner July 27, 2025 06:42
@Josh-Cena Josh-Cena requested review from sideshowbarker and removed request for a team July 27, 2025 06:42
@github-actions github-actions bot added Content:WebAPI Web API docs size/xs [PR only] 0-5 LoC changed labels Jul 27, 2025
Copy link
Contributor

github-actions bot commented Jul 27, 2025

Preview URLs

(comment last updated: 2025-08-12 01:34:36)

@@ -10,6 +10,8 @@ browser-compat: api.AnalyserNode.getFloatTimeDomainData

The **`getFloatTimeDomainData()`** method of the {{ domxref("AnalyserNode") }} Interface copies the current waveform, or time-domain, data into a {{jsxref("Float32Array")}} array passed into it. Each array value is a _sample_, the magnitude of the signal at a particular time.

The waveform is encoded as PCM data, which has a nominal range of -1.0 to 1.0, but values can exceed the range such as when down-mixing stereo to mono.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's a bit of a duplicate of the paragraph above, that says it's a copy of the waveform data. But I looked elsewhere on MDN, and I think we should say that waveform data are nominally in [-1, 1] at least once, e.g. in https://developer.mozilla.org/en-US/docs/Web/API/Web_Audio_API/Basic_concepts_behind_Web_Audio_API in which we say it's float 32-bits.

encoded might be a bit strange because the data is copied unaltered (which is important).

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Re: duplication, "A sample, the magnitude of the signal" sounds a bit less straightforward than "PCM data" to me as an amateur. The guide page you linked doesn't really talk about the data encoding at all, so I think this looks like the best place to put it. Would "represented" be a better word?

Copy link
Member

@sideshowbarker sideshowbarker left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@Josh-Cena I don’t have any special insight to offer here, so I’m going ahead and marking it approved, but leaving it unmerged and up to you whether to wait for resolution of the review comment (or else leave that as an issue for a follow-up PR)

@Josh-Cena
Copy link
Member Author

@padenot PTAL, thanks!

@padenot
Copy link
Contributor

padenot commented Aug 12, 2025

Looks good, thanks!

@Josh-Cena
Copy link
Member Author

Thanks both :)

@Josh-Cena Josh-Cena merged commit ba84d74 into mdn:main Aug 12, 2025
8 checks passed
@Josh-Cena Josh-Cena deleted the getFloatTimeDomainData-range branch August 12, 2025 11:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Content:WebAPI Web API docs size/xs [PR only] 0-5 LoC changed
Projects
None yet
Development

Successfully merging this pull request may close these issues.

AnalyserNode::getFloatTimeDomainData() doesn't specify the encoding of the waveform
3 participants