From 33058f2b292b3a581333bdfb21b8f671898c5060 Mon Sep 17 00:00:00 2001 From: Peter Bengtsson Date: Tue, 8 Dec 2020 14:40:17 -0500 Subject: initial commit --- .../web/api/audiocontext/baselatency/index.html | 54 ++++++++++++++++++++++ 1 file changed, 54 insertions(+) create mode 100644 files/zh-cn/web/api/audiocontext/baselatency/index.html (limited to 'files/zh-cn/web/api/audiocontext/baselatency') diff --git a/files/zh-cn/web/api/audiocontext/baselatency/index.html b/files/zh-cn/web/api/audiocontext/baselatency/index.html new file mode 100644 index 0000000000..219fc42429 --- /dev/null +++ b/files/zh-cn/web/api/audiocontext/baselatency/index.html @@ -0,0 +1,54 @@ +--- +title: AudioContext.baseLatency +slug: Web/API/AudioContext/baseLatency +translation_of: Web/API/AudioContext/baseLatency +--- +

{{SeeCompatTable}}{{APIRef("Web Audio API")}}

+ +

The baseLatency read-only property of the {{domxref("AudioContext")}} interface returns a double that represents the number of seconds of processing latency incurred by the AudioContext passing the audio from the {{domxref("AudioDestinationNode")}} to the audio subsystem.

+ +

You can request a certain latency during {{domxref("AudioContext.AudioContext()", "construction time", "", "true")}} with the latencyHint option but the browser may ignore the option.

+ +

Syntax

+ +
var baseLatency = audioCtx.baseLatency;
+ +

Value

+ +

A double representing the base latency in seconds.

+ +

Example

+ +
//default latency ("interactive")
+const audioCtx1 = new AudioContext();
+console.log(audioCtx1.baseLatency);//0.01
+
+//higher latency ("playback")
+const audioCtx2 = new AudioContext({ latencyHint: 'playback' });
+console.log(audioCtx2.baseLatency);//0.02
+
+ +

Specifications

+ + + + + + + + + + + + + + +
SpecificationStatusComment
{{SpecName('Web Audio API','#dom-audiocontext-baselatency','baseLatency')}}{{Spec2('Web Audio API')}}Initial definition.
+ +

Browser Compatibility

+ +
+ + +

{{Compat("api.AudioContext.baseLatency")}}

+
-- cgit v1.2.3-54-g00ecf