aboutsummaryrefslogtreecommitdiff
path: root/files/zh-cn/web/api/audiocontext/baselatency
diff options
context:
space:
mode:
authorPeter Bengtsson <mail@peterbe.com>2020-12-08 14:40:17 -0500
committerPeter Bengtsson <mail@peterbe.com>2020-12-08 14:40:17 -0500
commit33058f2b292b3a581333bdfb21b8f671898c5060 (patch)
tree51c3e392513ec574331b2d3f85c394445ea803c6 /files/zh-cn/web/api/audiocontext/baselatency
parent8b66d724f7caf0157093fb09cfec8fbd0c6ad50a (diff)
downloadtranslated-content-33058f2b292b3a581333bdfb21b8f671898c5060.tar.gz
translated-content-33058f2b292b3a581333bdfb21b8f671898c5060.tar.bz2
translated-content-33058f2b292b3a581333bdfb21b8f671898c5060.zip
initial commit
Diffstat (limited to 'files/zh-cn/web/api/audiocontext/baselatency')
-rw-r--r--files/zh-cn/web/api/audiocontext/baselatency/index.html54
1 files changed, 54 insertions, 0 deletions
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
+---
+<p>{{SeeCompatTable}}{{APIRef("Web Audio API")}}</p>
+
+<p class="summary">The <strong><code>baseLatency</code></strong> read-only property of the {{domxref("AudioContext")}} interface returns a double that represents the number of seconds of processing latency incurred by the <code>AudioContext</code> passing the audio from the {{domxref("AudioDestinationNode")}} to the audio subsystem.</p>
+
+<p>You can request a certain latency during {{domxref("AudioContext.AudioContext()", "construction time", "", "true")}} with the <code>latencyHint</code> option but the browser may ignore the option.</p>
+
+<h2 id="Syntax">Syntax</h2>
+
+<pre class="syntaxbox">var <em>baseLatency</em> = <em>audioCtx</em>.baseLatency;</pre>
+
+<h3 id="Value">Value</h3>
+
+<p>A double representing the base latency in seconds.</p>
+
+<h2 id="Example">Example</h2>
+
+<pre class="brush: js">//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
+</pre>
+
+<h2 id="Specifications">Specifications</h2>
+
+<table class="standard-table">
+ <tbody>
+ <tr>
+ <th scope="col">Specification</th>
+ <th scope="col">Status</th>
+ <th scope="col">Comment</th>
+ </tr>
+ <tr>
+ <td>{{SpecName('Web Audio API','#dom-audiocontext-baselatency','baseLatency')}}</td>
+ <td>{{Spec2('Web Audio API')}}</td>
+ <td>Initial definition.</td>
+ </tr>
+ </tbody>
+</table>
+
+<h2 id="Browser_Compatibility">Browser Compatibility</h2>
+
+<div>
+
+
+<p>{{Compat("api.AudioContext.baseLatency")}}</p>
+</div>