AudioEncoder: flush() method

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

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

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

The **flush()** method of the {{domxref("AudioEncoder")}} interface returns a Promise that resolves once all pending messages in the queue have been completed.

Syntax

js-nolint
flush()

Parameters

None.

Return value

A {{jsxref("Promise")}} that resolves with undefined.

Exceptions

  • InvalidStateError {{domxref("DOMException")}}
  • : Thrown if the Promise is rejected because the {{domxref("AudioEncoder.state","state")}} is not "configured".

Examples

The following example flushes the AudioEncoder.

js
AudioEncoder.flush();

Specifications

{{Specifications}}

Browser compatibility

{{Compat}}