AudioData

The AudioData interface of the WebCodecs API represents an audio sample.

MDN Reference

Constructors

Link copied to clipboard
constructor(init: AudioDataInit)

Properties

Link copied to clipboard

The duration read-only property of the AudioData interface returns the duration in microseconds of this AudioData object.

Link copied to clipboard

The format read-only property of the AudioData interface returns the sample format of the AudioData object.

Link copied to clipboard

The numberOfChannels read-only property of the AudioData interface returns the number of channels in the AudioData object.

Link copied to clipboard

The numberOfFrames read-only property of the AudioData interface returns the number of frames in the AudioData object.

Link copied to clipboard

The sampleRate read-only property of the AudioData interface returns the sample rate in Hz.

Link copied to clipboard

The timestamp read-only property of the AudioData interface returns the timestamp of this AudioData object.

Functions

Link copied to clipboard

The allocationSize() method of the AudioData interface returns the size in bytes required to hold the current sample as filtered by options passed into the method.

Link copied to clipboard

The clone() method of the AudioData interface creates a new AudioData object with reference to the same media resource as the original.

Link copied to clipboard
fun close()

The close() method of the AudioData interface clears all states and releases the reference to the media resource.

Link copied to clipboard

The copyTo() method of the AudioData interface copies a plane of an AudioData object to a destination buffer.