aboutsummaryrefslogtreecommitdiff
path: root/files/zh-cn/web/api/offlineaudiocontext
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/offlineaudiocontext
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/offlineaudiocontext')
-rw-r--r--files/zh-cn/web/api/offlineaudiocontext/complete/index.html81
-rw-r--r--files/zh-cn/web/api/offlineaudiocontext/index.html250
-rw-r--r--files/zh-cn/web/api/offlineaudiocontext/length/index.html89
-rw-r--r--files/zh-cn/web/api/offlineaudiocontext/offlineaudiocontext/index.html120
-rw-r--r--files/zh-cn/web/api/offlineaudiocontext/suspend/index.html111
5 files changed, 651 insertions, 0 deletions
diff --git a/files/zh-cn/web/api/offlineaudiocontext/complete/index.html b/files/zh-cn/web/api/offlineaudiocontext/complete/index.html
new file mode 100644
index 0000000000..74bdb5f3ff
--- /dev/null
+++ b/files/zh-cn/web/api/offlineaudiocontext/complete/index.html
@@ -0,0 +1,81 @@
+---
+title: 'OfflineAudioContext: complete event'
+slug: Web/API/OfflineAudioContext/complete
+translation_of: Web/API/OfflineAudioContext/complete_event
+---
+<p><font><font>{{DefaultAPISidebar("Web Audio API")}}</font></font></p>
+
+<p><code>complete</code><font><font>当离线音频上下文的呈现完成时,将触发{{domxref("OfflineAudioContext")}}接口</font><font>的</font><font>事件。</font></font></p>
+
+<table class="properties">
+ <tbody>
+ <tr>
+ <th scope="row"><font><font>泡泡</font></font></th>
+ <td><font><font>没有</font></font></td>
+ </tr>
+ <tr>
+ <th scope="row"><font><font>取消</font></font></th>
+ <td><font><font>没有</font></font></td>
+ </tr>
+ <tr>
+ <th scope="row"><font><font>默认操作</font></font></th>
+ <td><font><font>没有</font></font></td>
+ </tr>
+ <tr>
+ <th scope="row"><font><font>接口</font></font></th>
+ <td><font><font>{{domxref( "OfflineAudioCompletionEvent")}}</font></font></td>
+ </tr>
+ <tr>
+ <th scope="row"><font><font>事件处理程序属性</font></font></th>
+ <td><font><font>{{domxref( "OfflineAudioContext.oncomplete")}}</font></font></td>
+ </tr>
+ </tbody>
+</table>
+
+<h2 id="例子"><font><font>例子</font></font></h2>
+
+<p><font><font>处理完成后,您可能希望使用</font></font><code>oncomplete</code><font><font>处理程序提示用户现在可以播放音频,并启用播放按钮:</font></font></p>
+
+<pre class="brush: js"><font><font>offlineAudioCtx.addEventListener('complete',()=&gt; {</font></font>
+ console.log('Offline audio processing now complete');
+ showModalDialog('Song processed and ready to play');
+ playBtn.disabled = false;
+})</pre>
+
+<p>You can also set up the event handler using the {{domxref("OfflineAudioContext.oncomplete")}} property:</p>
+
+<pre class="brush: js">offlineAudioCtx.oncomplete = function() {
+ console.log('Offline audio processing now complete');
+ showModalDialog('Song processed and ready to play');
+ playBtn.disabled = false;
+}</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', '#OfflineAudioCompletionEvent-section', 'OfflineAudioCompletionEvent')}}</td>
+ <td>{{Spec2('Web Audio API')}}</td>
+ <td> </td>
+ </tr>
+ </tbody>
+</table>
+
+<h2 id="Browser_compatibility">Browser compatibility</h2>
+
+
+
+<p>{{Compat("api.OfflineAudioContext.complete_event")}}</p>
+
+<h2 id="See_also">See also</h2>
+
+<ul>
+ <li><font><font>{{domxref( "离线音频上下文.oncomplete")}}</font></font></li>
+ <li><a href="/en-US/docs/Web_Audio_API" title="/en-US/docs/CSS/Using_CSS_animations"><font><font>Web Audio API</font></font></a></li>
+</ul>
diff --git a/files/zh-cn/web/api/offlineaudiocontext/index.html b/files/zh-cn/web/api/offlineaudiocontext/index.html
new file mode 100644
index 0000000000..4f7a869dd2
--- /dev/null
+++ b/files/zh-cn/web/api/offlineaudiocontext/index.html
@@ -0,0 +1,250 @@
+---
+title: OfflineAudioContext
+slug: Web/API/OfflineAudioContext
+translation_of: Web/API/OfflineAudioContext
+---
+<div>{{APIRef("Web Audio API")}}</div>
+
+<p><code>OfflineAudioContext</code> 接口是一个 {{domxref("AudioContext")}} 的接口,代表由多个 {{domxref("AudioNode")}} 连接在一起构成的音频处理图。与 {{domxref("AudioContext")}} 标准相反的是, <code>OfflineAudioContext</code> 不在硬件设备渲染音频;相反,它尽可能快地生成音频,输出一个 {{domxref("AudioBuffer")}} 作为结果。</p>
+
+<h2 id="构造函数">构造函数</h2>
+
+<dl>
+ <dt>{{domxref("OfflineAudioContext.OfflineAudioContext()")}}</dt>
+ <dd>创建一个新的 <code>OfflineAudioContext</code> 实例。</dd>
+</dl>
+
+<h2 id="属性">属性</h2>
+
+<p><em>从父级 {{domxref("AudioContext")}} 获取属性。</em></p>
+
+<dl>
+ <dt>{{domxref('OfflineAudioContext.length')}} {{readonlyinline}}</dt>
+ <dd>代表采样帧缓冲区大小的整数。</dd>
+</dl>
+
+<h3 id="事件处理程序">事件处理程序</h3>
+
+<dl>
+ <dt>{{domxref("OfflineAudioContext.oncomplete")}}</dt>
+ <dd>当进程完成时,基于事件版本的{{domxref("OfflineAudioContext.startRendering()")}} 被使用之后,{{domxref("EventHandler")}} 将会被调用,{{event("complete")}} 事件类型为 {{domxref("OfflineAudioCompletionEvent")}})被触发。</dd>
+</dl>
+
+<h2 id="方法">方法</h2>
+
+<p><em>从父级 {{domxref("AudioContext")}} 和 {{domxref("EventTarget")}} 获取方法的实现。</em></p>
+
+<dl>
+ <dt>{{domxref("OfflineAudioContext.resume()")}}</dt>
+ <dd>恢复一个被暂停的音频的时间进程。</dd>
+ <dt>{{domxref("OfflineAudioContext.suspend()")}}</dt>
+ <dd>在指定的时间安排音频暂停时间进程,并且通过 Promise 返回。</dd>
+ <dt>{{domxref("OfflineAudioContext.startRendering()")}}</dt>
+ <dd>开始渲染音频,考虑当前连接和当前计划的修改。这个页面涵盖基于事件的和基于 Promise 的版本。</dd>
+</dl>
+
+<h2 id="例子">例子</h2>
+
+<p>这个简单的例子中,我们声明了 {{domxref("AudioContext")}} 和 <code>OfflineAudioContext</code> 对象。我们使用 <code>AudioContext</code> 去加载一个 XHR ({{domxref("AudioContext.decodeAudioData")}})获取的音轨,然后使用 <code>OfflineAudioContext</code> 去渲染音频并得到一个 into an {{domxref("AudioBufferSourceNode")}},并播放这个音轨。在离线音频处理图建立后,你需要去使用 {{domxref("OfflineAudioContext.startRendering")}} 来渲染它成为 {{domxref("AudioBuffer")}}。</p>
+
+<p>当 <code>startRendering()</code> 的 Promise 解决后,渲染也完成了,在 Promise 内可以获得输出的 <code>AudioBuffer。</code></p>
+
+<p>在此刻,我们创建了一个另外的音频上下文,在它里面创建了一个 {{domxref("AudioBufferSourceNode")}},并且设置它的 buffer 为之前生成的 Promise 中的 <code>AudioBuffer。这样它就可以作为简单标准音频图来播放了</code>。</p>
+
+<div class="note">
+<p><strong>注意</strong>: 为了获取可以运行的例子,请看我们在 Github 的仓库 <a href="https://mdn.github.io/webaudio-examples/offline-audio-context-promise/">offline-audio-context-promise</a> (也可以看到 <a href="https://github.com/mdn/webaudio-examples/tree/master/offline-audio-context-promise">源代码</a>。)</p>
+</div>
+
+<pre class="brush: js">// 定义一个在线或者离线的音频上下文
+
+var audioCtx = new AudioContext();
+var offlineCtx = new OfflineAudioContext(2,44100*40,44100);
+
+source = offlineCtx.createBufferSource();
+
+// 使用 XHR 去加载一个音轨,
+// 使用 decodeAudioData 去解码,
+// 使用 OfflineAudioContext 去渲染它
+
+function getData() {
+ request = new XMLHttpRequest();
+
+ request.open('GET', 'viper.ogg', true);
+
+ request.responseType = 'arraybuffer';
+
+ request.onload = function() {
+ var audioData = request.response;
+
+ audioCtx.decodeAudioData(audioData, function(buffer) {
+ myBuffer = buffer;
+ source.buffer = myBuffer;
+ source.connect(offlineCtx.destination);
+ source.start();
+ //source.loop = true;
+ offlineCtx.startRendering().then(function(renderedBuffer) {
+ console.log('渲染完全成功');
+ var audioCtx = new (window.AudioContext || window.webkitAudioContext)();
+ var song = audioCtx.createBufferSource();
+ song.buffer = renderedBuffer;
+
+ song.connect(audioCtx.destination);
+
+ play.onclick = function() {
+ song.start();
+ }
+ }).catch(function(err) {
+ console.log('渲染失败: ' + err);
+ // 注意: 当 OfflineAudioContext 上 startRendering 被立刻调用,Promise 应该被 reject
+ });
+ });
+ }
+
+ request.send();
+}
+
+// 运行 getData 去开始这个进程
+
+getData();</pre>
+
+<h2 id="备注">备注</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', '#OfflineAudioContext', 'OfflineAudioContext')}}</td>
+ <td>{{Spec2('Web Audio API')}}</td>
+ <td>Initial definition</td>
+ </tr>
+ </tbody>
+</table>
+
+<h2 id="浏览器兼容性">浏览器兼容性</h2>
+
+<div>{{CompatibilityTable}}</div>
+
+<div id="compat-desktop">
+<table class="compat-table">
+ <tbody>
+ <tr>
+ <th>Feature</th>
+ <th>Chrome</th>
+ <th>Edge</th>
+ <th>Firefox (Gecko)</th>
+ <th>Internet Explorer</th>
+ <th>Opera</th>
+ <th>Safari (WebKit)</th>
+ </tr>
+ <tr>
+ <td>Basic support</td>
+ <td>{{CompatChrome(10.0)}}{{property_prefix("webkit")}}</td>
+ <td>{{CompatVersionUnknown}}</td>
+ <td>{{CompatGeckoDesktop(25.0)}}</td>
+ <td>{{CompatNo}}</td>
+ <td>15.0{{property_prefix("webkit")}}<br>
+ 22 (unprefixed)</td>
+ <td>6.0{{property_prefix("webkit")}}</td>
+ </tr>
+ <tr>
+ <td>Promise-based <code>startRendering()</code></td>
+ <td>{{CompatChrome(42.0)}}</td>
+ <td>{{CompatUnknown}}</td>
+ <td>{{CompatGeckoDesktop(37.0)}}</td>
+ <td>{{CompatUnknown}}</td>
+ <td>{{CompatUnknown}}</td>
+ <td>{{CompatUnknown}}</td>
+ </tr>
+ <tr>
+ <td><code>suspend()</code>, <code>resume()</code></td>
+ <td>{{CompatChrome(49.0)}}</td>
+ <td>{{CompatUnknown}}</td>
+ <td> </td>
+ <td> </td>
+ <td> </td>
+ <td> </td>
+ </tr>
+ <tr>
+ <td><code>length</code></td>
+ <td>{{CompatChrome(51.0)}}</td>
+ <td>{{CompatUnknown}}</td>
+ <td> </td>
+ <td> </td>
+ <td> </td>
+ <td> </td>
+ </tr>
+ </tbody>
+</table>
+</div>
+
+<div id="compat-mobile">
+<table class="compat-table">
+ <tbody>
+ <tr>
+ <th>Feature</th>
+ <th>Android Webview</th>
+ <th>Firefox Mobile (Gecko)</th>
+ <th>Firefox OS</th>
+ <th>Edge</th>
+ <th>IE Mobile</th>
+ <th>Opera Mobile</th>
+ <th>Safari Mobile</th>
+ <th>Chrome for Android</th>
+ </tr>
+ <tr>
+ <td>Basic support</td>
+ <td>{{CompatChrome(33.0)}}</td>
+ <td>26.0</td>
+ <td>1.2</td>
+ <td>{{CompatVersionUnknown}}</td>
+ <td>{{CompatUnknown}}</td>
+ <td>{{CompatUnknown}}</td>
+ <td>{{CompatUnknown}}</td>
+ <td>{{CompatVersionUnknown}}</td>
+ </tr>
+ <tr>
+ <td>Promise-based <code>startRendering()</code></td>
+ <td>{{CompatChrome(42.0)}}</td>
+ <td>37.0</td>
+ <td>2.2</td>
+ <td>{{CompatUnknown}}</td>
+ <td>{{CompatUnknown}}</td>
+ <td>{{CompatUnknown}}</td>
+ <td>{{CompatUnknown}}</td>
+ <td>{{CompatChrome(42.0)}}</td>
+ </tr>
+ <tr>
+ <td><code>suspend()</code>, <code>resume()</code></td>
+ <td>{{CompatChrome(49.0)}}</td>
+ <td> </td>
+ <td> </td>
+ <td>{{CompatUnknown}}</td>
+ <td> </td>
+ <td> </td>
+ <td> </td>
+ <td>{{CompatChrome(49.0)}}</td>
+ </tr>
+ <tr>
+ <td><code>length</code></td>
+ <td>{{CompatChrome(51.0)}}</td>
+ <td> </td>
+ <td> </td>
+ <td>{{CompatUnknown}}</td>
+ <td> </td>
+ <td> </td>
+ <td> </td>
+ <td>{{CompatChrome(51.0)}}</td>
+ </tr>
+ </tbody>
+</table>
+</div>
+
+<h2 id="参见">参见</h2>
+
+<ul>
+ <li><a href="/zh-CN/docs/Web/API/Web_Audio_API/Using_Web_Audio_API">Web Audio API 的运用</a></li>
+</ul>
diff --git a/files/zh-cn/web/api/offlineaudiocontext/length/index.html b/files/zh-cn/web/api/offlineaudiocontext/length/index.html
new file mode 100644
index 0000000000..86bfdb3a14
--- /dev/null
+++ b/files/zh-cn/web/api/offlineaudiocontext/length/index.html
@@ -0,0 +1,89 @@
+---
+title: OfflineAudoContext.length
+slug: Web/API/OfflineAudioContext/length
+translation_of: Web/API/OfflineAudioContext/length
+---
+<p>{{SeeCompatTable}}{{ APIRef("Web Audio API") }}</p>
+
+<p>{{domxref("OfflineAudioContext")}} 接口的 <strong><code>length</code></strong> 属性返回一个代表采样帧的缓冲区大小的整数。</p>
+
+<h2 id="语法">语法</h2>
+
+<pre class="syntaxbox">var length = OfflineAudioContext.length;</pre>
+
+<h3 id="值">值</h3>
+
+<p>一个代表采样帧的缓冲区大小的整数。</p>
+
+<h2 id="标准">标准</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','#widl-OfflineAudioContext-length','length')}}</td>
+ <td>{{Spec2('Web Audio API')}}</td>
+ <td>Initial definition.</td>
+ </tr>
+ </tbody>
+</table>
+
+<h2 id="浏览器兼容性">浏览器兼容性</h2>
+
+<p>{{CompatibilityTable}}</p>
+
+<div id="compat-desktop">
+<table class="compat-table">
+ <tbody>
+ <tr>
+ <th>Feature</th>
+ <th>Chrome</th>
+ <th>Firefox (Gecko)</th>
+ <th>Internet Explorer</th>
+ <th>Opera</th>
+ <th>Safari (WebKit)</th>
+ </tr>
+ <tr>
+ <td>Basic support</td>
+ <td>{{CompatChrome(51.0)}}</td>
+ <td>{{CompatUnknown}}</td>
+ <td>{{CompatUnknown}}</td>
+ <td>{{CompatUnknown}}</td>
+ <td>{{CompatUnknown}}</td>
+ </tr>
+ </tbody>
+</table>
+</div>
+
+<div id="compat-mobile">
+<table class="compat-table">
+ <tbody>
+ <tr>
+ <th>Feature</th>
+ <th>Android</th>
+ <th>Android Webview</th>
+ <th>Firefox Mobile (Gecko)</th>
+ <th>Firefox OS</th>
+ <th>IE Mobile</th>
+ <th>Opera Mobile</th>
+ <th>Safari Mobile</th>
+ <th>Chrome for Android</th>
+ </tr>
+ <tr>
+ <td>Basic support</td>
+ <td>{{CompatNo}}</td>
+ <td>{{CompatChrome(51.0)}}</td>
+ <td>{{CompatUnknown}}</td>
+ <td>{{CompatUnknown}}</td>
+ <td>{{CompatUnknown}}</td>
+ <td>{{CompatUnknown}}</td>
+ <td>{{CompatUnknown}}</td>
+ <td>{{CompatChrome(51.0)}}</td>
+ </tr>
+ </tbody>
+</table>
+</div>
diff --git a/files/zh-cn/web/api/offlineaudiocontext/offlineaudiocontext/index.html b/files/zh-cn/web/api/offlineaudiocontext/offlineaudiocontext/index.html
new file mode 100644
index 0000000000..e811ad5188
--- /dev/null
+++ b/files/zh-cn/web/api/offlineaudiocontext/offlineaudiocontext/index.html
@@ -0,0 +1,120 @@
+---
+title: OfflineAudioContext.OfflineAudioContext()
+slug: Web/API/OfflineAudioContext/OfflineAudioContext
+translation_of: Web/API/OfflineAudioContext/OfflineAudioContext
+---
+<p>{{APIRef("Web Audio API")}}</p>
+
+<p><code><strong>OfflineAudioContext()</strong></code> 构造函数创建一个新的 {{domxref("OfflineAudioContext")}} 对象实例。</p>
+
+<h2 id="语法">语法</h2>
+
+<pre class="brush: js">var myOfflineAudio = new OfflineAudioContext(numOfChannels,length,sampleRate);</pre>
+
+<h3 id="参数">参数</h3>
+
+<dl>
+ <dt>numOfChannels</dt>
+ <dd>An integer 代表该缓冲区拥有的声道的数目。该实现需要支持至少32个声道。</dd>
+ <dt>length</dt>
+ <dd>代表采样帧缓冲区的大小的整数。</dd>
+ <dt>sampleRate</dt>
+ <dd>采样帧每一秒的线性音频数据的采样率。该实现必须支持在 22050 到 96000 之间的采样率,44100 是最经常用到的采样率。</dd>
+</dl>
+
+<p>这里有个重要的警告,你可以通过不带参数的使用 <code>new AudioContext()</code> 构造函数创建一个新的 {{domxref("AudioContext")}},但是 <code>OfflineAudioContext()</code> 构造函数必须带上三个参数。当你通过 {{domxref("AudioContext.createBuffer")}} 方法创建一个新的{{domxref("AudioBuffer")}} 时,你也是需要做一样的事情。想要知道更多信息,请阅读我们的基本概念指南的 <a href="/zh-CN/docs/Web/API/Web_Audio_API/Basic_concepts_behind_Web_Audio_API#音频片段:帧,样本和声道">音频片段:帧,样本和声道</a>。</p>
+
+<div class="note">
+<p><strong>注意</strong>:像普通的 <code>AudioContext</code>,<code>OfflineAudioContext</code> 可以成为事件的目标,因此它的实现是 {{domxref("EventTarget")}} 接口。</p>
+</div>
+
+<h2 id="例子">例子</h2>
+
+<pre class="brush: js line-numbers language-js"><code class="language-js"><span class="comment token">// 定义一个在线或者离线的音频上下文</span>
+
+<span class="keyword token">var</span> audioCtx <span class="operator token">=</span> <span class="keyword token">new</span> <span class="class-name token">AudioContext</span><span class="punctuation token">(</span><span class="punctuation token">)</span><span class="punctuation token">;</span>
+<span class="keyword token">var</span> offlineCtx <span class="operator token">=</span> <span class="keyword token">new</span> <span class="class-name token">OfflineAudioContext</span><span class="punctuation token">(</span><span class="number token">2</span><span class="punctuation token">,</span><span class="number token">44100</span><span class="operator token">*</span><span class="number token">40</span><span class="punctuation token">,</span><span class="number token">44100</span><span class="punctuation token">)</span><span class="punctuation token">;</span>
+
+source <span class="operator token">=</span> offlineCtx<span class="punctuation token">.</span><span class="function token">createBufferSource</span><span class="punctuation token">(</span><span class="punctuation token">)</span><span class="punctuation token">;
+
+// 更多代码...</span></code>
+</pre>
+
+<div class="note">
+<p><strong>注意</strong>: 想要获取完整的例子,请看我们在 Github 仓库的 <a class="external external-icon" href="http://mdn.github.io/offline-audio-context-promise/">offline-audio-context-promise</a> (也可以看 <a class="external external-icon" href="https://github.com/mdn/offline-audio-context-promise">源代码</a> )</p>
+</div>
+
+<h2 id="标准">标准</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','#OfflineAudioContext','OfflineAudioContext')}}</td>
+ <td>{{Spec2('Web Audio API')}}</td>
+ <td> </td>
+ </tr>
+ </tbody>
+</table>
+
+<h2 id="浏览器兼容性">浏览器兼容性</h2>
+
+<p>{{ CompatibilityTable() }}</p>
+
+<div id="compat-desktop">
+<table class="compat-table">
+ <tbody>
+ <tr>
+ <th>Feature</th>
+ <th>Chrome</th>
+ <th>Firefox (Gecko)</th>
+ <th>Internet Explorer</th>
+ <th>Opera</th>
+ <th>Safari (WebKit)</th>
+ </tr>
+ <tr>
+ <td>Basic support</td>
+ <td>{{CompatVersionUnknown}}<br>
+  </td>
+ <td>{{CompatVersionUnknown}}</td>
+ <td>{{ CompatNo }}</td>
+ <td>
+ <p>{{CompatVersionUnknown}}</p>
+ </td>
+ <td>{{CompatNo}}</td>
+ </tr>
+ </tbody>
+</table>
+</div>
+
+<div id="compat-mobile">
+<table class="compat-table">
+ <tbody>
+ <tr>
+ <th>Feature</th>
+ <th>Android</th>
+ <th>Android Webview</th>
+ <th>Firefox Mobile (Gecko)</th>
+ <th>IE Phone</th>
+ <th>Opera Mobile</th>
+ <th>Safari Mobile</th>
+ <th>Chrome for Android</th>
+ </tr>
+ <tr>
+ <td>Basic support</td>
+ <td>{{ CompatNo }}</td>
+ <td>{{CompatVersionUnknown}}<br>
+  </td>
+ <td>{{CompatVersionUnknown}}</td>
+ <td>{{ CompatNo }}</td>
+ <td>{{CompatVersionUnknown}}</td>
+ <td>{{ CompatNo }}</td>
+ <td>{{CompatVersionUnknown}}</td>
+ </tr>
+ </tbody>
+</table>
+</div>
diff --git a/files/zh-cn/web/api/offlineaudiocontext/suspend/index.html b/files/zh-cn/web/api/offlineaudiocontext/suspend/index.html
new file mode 100644
index 0000000000..26b475b126
--- /dev/null
+++ b/files/zh-cn/web/api/offlineaudiocontext/suspend/index.html
@@ -0,0 +1,111 @@
+---
+title: suspend
+slug: Web/API/OfflineAudioContext/suspend
+translation_of: Web/API/OfflineAudioContext/suspend
+---
+<p>{{ APIRef("Web Audio API") }}</p>
+
+<p>The <strong><code>suspend()</code></strong> method of the {{ domxref("OfflineAudioContext") }} interface schedules a suspension of the time progression in the audio context at the specified time and returns a promise. This is generally useful at the time of manipulating the audio graph synchronously on OfflineAudioContext.</p>
+
+<p>Note that the maximum precision of suspension is the size of the render quantum and the specified suspension time will be rounded down to the nearest render quantum boundary. For this reason, it is not allowed to schedule multiple suspends at the same quantized frame. Also scheduling should be done while the context is not running to ensure the precise suspension.</p>
+
+<h2 id="语法">语法</h2>
+
+<pre class="syntaxbox">OfflineAudioContext.suspend(<em>suspendTime</em>).then(function() { ... });</pre>
+
+<h3 id="参数">参数</h3>
+
+<dl>
+ <dt>暂停时间</dt>
+ <dd>A {{jsxref("double")}} 指定暂停的时间.</dd>
+</dl>
+
+<h3 id="返回值">返回值</h3>
+
+<p>A {{jsxref("Promise")}} resolving to void.</p>
+
+<h3 id="异常">异常</h3>
+
+<p>发生任何异常,promise就会拒绝.</p>
+
+<p>如果帧数出现下列情况,就会抛出错误{{exception("InvalidStateError")}}:</p>
+
+<ul>
+ <li>一个负值</li>
+ <li>小于或等于当前时间</li>
+ <li>大于或等于渲染的总渲染时间</li>
+ <li>is scheduled by another suspend for the same time</li>
+</ul>
+
+<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', '#widl-OfflineAudioContext-suspend-Promise-void--double-suspendTime', 'suspend()')}}</td>
+ <td>{{Spec2('Web Audio API')}}</td>
+ <td>Initial definition.</td>
+ </tr>
+ </tbody>
+</table>
+
+<h2 id="Browser_compatibility">Browser compatibility</h2>
+
+<div>{{CompatibilityTable}}</div>
+
+<div id="compat-desktop">
+<table class="compat-table">
+ <tbody>
+ <tr>
+ <th>Feature</th>
+ <th>Chrome</th>
+ <th>Firefox (Gecko)</th>
+ <th>Internet Explorer</th>
+ <th>Opera</th>
+ <th>Safari (WebKit)</th>
+ </tr>
+ <tr>
+ <td>Basic support</td>
+ <td>{{CompatChrome(49.0)}}</td>
+ <td> </td>
+ <td> </td>
+ <td> </td>
+ <td> </td>
+ </tr>
+ </tbody>
+</table>
+</div>
+
+<div id="compat-mobile">
+<table class="compat-table">
+ <tbody>
+ <tr>
+ <th>Feature</th>
+ <th>Android</th>
+ <th>Android Webview</th>
+ <th>Firefox Mobile (Gecko)</th>
+ <th>Firefox OS</th>
+ <th>IE Mobile</th>
+ <th>Opera Mobile</th>
+ <th>Safari Mobile</th>
+ <th>Chrome for Android</th>
+ </tr>
+ <tr>
+ <td>Basic support</td>
+ <td>{{CompatNo}}</td>
+ <td>{{CompatChrome(49.0)}}</td>
+ <td> </td>
+ <td> </td>
+ <td> </td>
+ <td> </td>
+ <td> </td>
+ <td>{{CompatChrome(49.0)}}</td>
+ </tr>
+ </tbody>
+</table>
+</div>