AudioData: clone() method

فهرست فصل‌ها دانلود آرشیوناشر

MDN Web Docs · نسخهٔ df622a2a1c1e · CC BY-SA 2.5 و مجوز جداگانهٔ ناشر برای نمونه‌کد

{{APIRef("WebCodecs API")}}{{AvailableInWorkers("window_and_dedicated")}}

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

Syntax

js-nolint
clone()

Parameters

None.

Return value

The cloned {{domxref("AudioData")}} object.

Exceptions

  • InvalidStateError {{domxref("DOMException")}}
  • : Thrown if the AudioData object has been transferred.

Examples

The following example clones a copy of AudioData as audioData2.

js
let audioData2 = AudioData.clone();

Specifications

{{Specifications}}

Browser compatibility

{{Compat}}