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

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

+ +

{{ domxref("AudioContext") }}インターフェースのresume()メソッドは、一時停止されたオーディオコンテキストの時間の流れを再開します。

+ +

{{domxref("OfflineAudioContext")}}でこのメソッドを呼ぶとINVALID_STATE_ERR例外が発生します。

+ +

構文

+ +
Promise<> baseAudioContext.resume();
+
+ +

引数

+ +

なし

+ +

戻り値

+ +

voidで完了する{{jsxref("Promise")}}。コンテキストが既に閉じている場合、プロミスは失敗します。

+ +

+ +

次のスニペットはAudioContext states デモ(すぐ実行)から取ったものです。suspend/resumeボタンをクリックすると、{{domxref("AudioContext.state")}}を問い合わせます—もしrunningならば、{{domxref("suspend()")}}が呼ばれます。suspendedならば、resume()が呼ばれます。両方ともプロミスに成功するとボタンのラベルが適したものに更新されます。

+ +
susresBtn.onclick = function() {
+  if(audioCtx.state === 'running') {
+    audioCtx.suspend().then(function() {
+      susresBtn.textContent = 'Resume context';
+    });
+  } else if(audioCtx.state === 'suspended') {
+    audioCtx.resume().then(function() {
+      susresBtn.textContent = 'Suspend context';
+    });
+  }
+}
+
+ +

仕様

+ + + + + + + + + + + + + + +
SpecificationStatusComment
{{SpecName('Web Audio API', '#dom-baseaudiocontext-resume', 'resume()')}}{{Spec2('Web Audio API')}} 
+ +

ブラウザ互換性

+ +
+
+ + +

{{Compat("api.BaseAudioContext.resume")}}

+
+
+ +

参考

+ + -- cgit v1.2.3-54-g00ecf