This page is Ready to Use

Notice: The WebPlatform project, supported by various stewards between 2012 and 2015, has been discontinued. This site is now available on github.

getByteFrequencyData

Summary

Copies the current frequency data into the passed unsigned byte array. If the array has fewer elements than the frequencyBinCount, the excess elements will be dropped.

Method of apis/webaudio/AnalyserNodeapis/webaudio/AnalyserNode

Syntax

var  = AnalyserNode.getByteFrequencyData(array);

Parameters

array

Data-type
void

Where frequency-domain analysis data will be copied.

Return Value

Returns an object of type

Uint8Array

Examples

var audioCtx = new AudioContext();
var analyser = audioCtx.createAnalyser();
// Uint8Array should be the same length as the frequencyBinCount
var dataArray = new Uint8Array(analyser.frequencyBinCount);
// fill the Uint8Array with data returned from getByteFrequencyData()
analyser.getByteFrequencyData(myDataArray);

Related specifications

Web Audio API
W3C Editor’s Draft