Path: blob/main/files/en-us/web/api/analysernode/getfloattimedomaindata/index.md
6532 views
------{{ APIRef("Web Audio API") }}
The getFloatTimeDomainData() method of the {{ domxref("AnalyserNode") }} Interface copies the current waveform, or time-domain, data into a {{jsxref("Float32Array")}} array passed into it.
Syntax
Parameters
array: The {{jsxref("Float32Array")}} that the time domain data will be copied to. If the array has fewer elements than the {{domxref("AnalyserNode.fftSize")}}, excess elements are dropped. If it has more elements than needed, excess elements are ignored.
Return value
None ({{jsxref("undefined")}}).
Examples
The following example shows basic usage of an {{domxref("AudioContext")}} to create an AnalyserNode, then {{domxref("window.requestAnimationFrame()","requestAnimationFrame")}} and {{htmlelement("canvas")}} to collect time domain data repeatedly and draw an "oscilloscope style" output of the current audio input. For more complete applied examples/information, check out our Voice-change-O-matic demo (see app.js lines 108–193 for relevant code).
Specifications
{{Specifications}}
Browser compatibility
{{Compat}}