aboutsummaryrefslogtreecommitdiff
path: root/files/ja/web/api/audiocontext/close
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/ja/web/api/audiocontext/close
parent8b66d724f7caf0157093fb09cfec8fbd0c6ad50a (diff)
downloadtranslated-content-33058f2b292b3a581333bdfb21b8f671898c5060.tar.gz
translated-content-33058f2b292b3a581333bdfb21b8f671898c5060.tar.bz2
translated-content-33058f2b292b3a581333bdfb21b8f671898c5060.zip
initial commit
Diffstat (limited to 'files/ja/web/api/audiocontext/close')
-rw-r--r--files/ja/web/api/audiocontext/close/index.html117
1 files changed, 117 insertions, 0 deletions
diff --git a/files/ja/web/api/audiocontext/close/index.html b/files/ja/web/api/audiocontext/close/index.html
new file mode 100644
index 0000000000..a53f04b8b8
--- /dev/null
+++ b/files/ja/web/api/audiocontext/close/index.html
@@ -0,0 +1,117 @@
+---
+title: AudioContext.close()
+slug: Web/API/AudioContext/close
+translation_of: Web/API/AudioContext/close
+---
+<p>{{ APIRef("Web Audio API") }}</p>
+
+<p>{{ domxref("AudioContext") }}インターフェースの<code>close()</code>メソッドは、オーディオコンテキストを閉じて使っていたシステムのオーディオリソースを全て解放します。</p>
+
+<p>閉じたコンテキストは新しいノードを生成できませんが、音声データのデコードやバッファの生成などは可能です。</p>
+
+<p>この関数は、他の参照も同様に解放されない限り、AudioContextが生成したオブジェクトは自動的には解放しません。しかし、これはオーディオリソースを強制的に解放します。よって、オーディオコンテキストの更なる生成と使用はできなくなり、オーディオコンテキストの時間の流れは止まり、音声データの処理は停止します。<br>
+ 全てのAudioContext-creation-blockingリソースが解放されたとき、返された{{jsxref("Promise")}}が完了します。このメソッドは{{domxref("OfflineAudioContext")}}で呼ばれたとき<code>INVALID_STATE_ERR</code>例外が発生します。<br>
+  </p>
+
+<h2 id="構文">構文</h2>
+
+<pre class="brush: js">var audioCtx = new AudioContext();
+audioCtx.close().then(function() { ... });
+</pre>
+
+<h3 id="戻り値">戻り値</h3>
+
+<p>voidで完了する{{jsxref("Promise")}}。</p>
+
+<h2 id="例">例</h2>
+
+<p>次のスニペットは<a class="external-icon external" href="https://github.com/mdn/audiocontext-states/settings">AudioContext states デモ</a>(<a class="external-icon external" href="http://mdn.github.io/audiocontext-states/">すぐ実行</a>)から取ったものです。stopボタンをクリックすると、<code>close()</code>が呼ばれます。プロミスに成功すると、リセットされ最初の状態に戻ります。</p>
+
+<pre class="brush: js">stopBtn.onclick = function() {
+  audioCtx.close().then(function() {
+    startBtn.removeAttribute('disabled');
+    susresBtn.setAttribute('disabled','disabled');
+    stopBtn.setAttribute('disabled','disabled');
+  });
+}
+</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', '#widl-AudioContext-close-Promise-void', 'close()')}}</td>
+ <td>{{Spec2('Web Audio API')}}</td>
+ <td> </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>Firefox (Gecko)</th>
+ <th>Internet Explorer</th>
+ <th>Opera</th>
+ <th>Safari (WebKit)</th>
+ </tr>
+ <tr>
+ <td>Basic support</td>
+ <td>{{CompatChrome(43.0)}}</td>
+ <td>{{CompatGeckoDesktop(40.0)}}</td>
+ <td>{{CompatNo}}</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>{{CompatNo}}</td>
+ <td>{{CompatUnknown}}</td>
+ <td>{{CompatUnknown}}</td>
+ <td>{{CompatUnknown}}</td>
+ <td>{{CompatUnknown}}</td>
+ <td>{{CompatUnknown}}</td>
+ <td>{{CompatNo}}</td>
+ </tr>
+ </tbody>
+</table>
+</div>
+
+<h2 id="参考">参考</h2>
+
+<ul>
+ <li><a href="/en-US/docs/Web_Audio_API/Using_Web_Audio_API">Using the Web Audio API</a></li>
+ <li><a href="/en-US/docs/Web/API/Web_Audio_API">Web Audio API</a></li>
+</ul>