aboutsummaryrefslogtreecommitdiff
path: root/files/ja/web/api/audiocontext/createdynamicscompressor
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/createdynamicscompressor
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/createdynamicscompressor')
-rw-r--r--files/ja/web/api/audiocontext/createdynamicscompressor/index.html138
1 files changed, 138 insertions, 0 deletions
diff --git a/files/ja/web/api/audiocontext/createdynamicscompressor/index.html b/files/ja/web/api/audiocontext/createdynamicscompressor/index.html
new file mode 100644
index 0000000000..2fa5ca43ed
--- /dev/null
+++ b/files/ja/web/api/audiocontext/createdynamicscompressor/index.html
@@ -0,0 +1,138 @@
+---
+title: AudioContext.createDynamicsCompressor()
+slug: Web/API/AudioContext/createDynamicsCompressor
+translation_of: Web/API/BaseAudioContext/createDynamicsCompressor
+---
+<p>{{ APIRef("Web Audio API") }}</p>
+
+<div>
+<p>{{ domxref("AudioContext") }}インターフェースの<code>createDynamicsCompressor()</code>メソッドは、音声信号にコンプレッサーを適用する{{domxref("DynamicsCompressorNode")}}を生成します。</p>
+</div>
+
+<p>コンプレッサーは、音声信号の最大部分の音量を小さくし、最小部分の音量を大きくします。一般的に、より大きく、豊かで、高密度な音になります。これはゲームや音楽アプリケーションでたくさんの別々の音を同時に再生する場合に特に重要です。このような場合、全体の音量の操作したり、出力音声のクリッピング(ひずみ)を避けたいはずです。</p>
+
+<h2 id="構文">構文</h2>
+
+<pre class="brush: js">var audioCtx = new AudioContext();
+var compressor = audioCtx.createDynamicsCompressor();</pre>
+
+<h3 id="戻り値">戻り値</h3>
+
+<p>{{domxref("DynamicsCompressorNode")}}</p>
+
+<h2 id="例">例</h2>
+
+<p>音声トラックにコンプレッサーを追加するために<code>createDynamicsCompressor()</code>を使う簡単なデモコードです。より完全なサンプルは、<a href="http://mdn.github.io/compressor-example/">basic Compressor example</a> (<a href="https://github.com/mdn/compressor-example">ソースコードの閲覧</a>)を参照してください。</p>
+
+<pre class="brush: js;highlight[6,18,19]">// MediaElementAudioSourceNodeを生成する
+// そこにHTMLMediaElementを入れる
+var source = audioCtx.createMediaElementSource(myAudio);
+
+// コンプレッサーノードを生成する
+var compressor = audioCtx.createDynamicsCompressor();
+compressor.threshold.value = -50;
+compressor.knee.value = 40;
+compressor.ratio.value = 12;
+compressor.reduction.value = -20;
+compressor.attack.value = 0;
+compressor.release.value = 0.25;
+
+// AudioBufferSourceNodeを行き先(destination)につなげる
+source.connect(audioCtx.destination);
+
+button.onclick = function() {
+ var active = button.getAttribute('data-active');
+ if(active == 'false') {
+ button.setAttribute('data-active', 'true');
+ button.innerHTML = 'Remove compression';
+
+ source.disconnect(audioCtx.destination);
+ source.connect(compressor);
+ compressor.connect(audioCtx.destination);
+ } else if(active == 'true') {
+ button.setAttribute('data-active', 'false');
+ button.innerHTML = 'Add compression';
+
+ source.disconnect(compressor);
+ compressor.disconnect(audioCtx.destination);
+ source.connect(audioCtx.destination);
+ }
+}</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-createDynamicsCompressor-DynamicsCompressorNode', 'createDynamicsCompressor()')}}</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(10.0)}}{{property_prefix("webkit")}}</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>
+ </tbody>
+</table>
+</div>
+
+<div id="compat-mobile">
+<table class="compat-table">
+ <tbody>
+ <tr>
+ <th>Feature</th>
+ <th>Android</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>{{CompatUnknown}}</td>
+ <td>26.0</td>
+ <td>1.2</td>
+ <td>{{CompatUnknown}}</td>
+ <td>{{CompatUnknown}}</td>
+ <td>{{CompatUnknown}}</td>
+ <td>33.0</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>
+</ul>