Please note, this is a STATIC archive of website developer.mozilla.org from 03 Nov 2016, cach3.com does not collect or store any user information, there is no "phishing" involved.

Revision 1031056 of DynamicsCompressorNode

  • Revision slug: Web/API/DynamicsCompressorNode
  • Revision title: DynamicsCompressorNode
  • Revision id: 1031056
  • Created:
  • Creator: padenotmoz
  • Is current revision? No
  • Comment

Revision Content

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

The DynamicsCompressorNode interface provides a compression effect, which lowers the volume of the loudest parts of the signal in order to help prevent clipping and distortion that can occur when multiple sounds are played and multiplexed together at once. This is often used in musical production and game audio. DynamicsCompressorNode is an {{domxref("AudioNode")}} that has exactly one input and one output; it is created using the {{domxref("AudioContext.createDynamicsCompressor")}} method.

Number of inputs 1
Number of outputs 1
Channel count mode "explicit"
Channel count 2
Channel interpretation "speakers"

Properties

Inherits properties from its parent, {{domxref("AudioNode")}}.

{{domxref("DynamicsCompressorNode.threshold")}} {{readonlyInline}}
Is a {{k-rate}} {{domxref("AudioParam")}} representing the decibel value above which the compression will start taking effect.
{{domxref("DynamicsCompressorNode.knee")}} {{readonlyInline}}
Is a {{k-rate}} {{domxref("AudioParam")}} containing a decibel value representing the range above the threshold where the curve smoothly transitions to the compressed portion.
{{domxref("DynamicsCompressorNode.ratio")}} {{readonlyInline}}
Is a {{k-rate}} {{domxref("AudioParam")}} representing the amount of change, in dB, needed in the input for a 1 dB change in the output.
{{domxref("DynamicsCompressorNode.reduction")}} {{readonlyInline}}
Is a float representing the amount of gain reduction currently applied by the compressor to the signal.
{{domxref("DynamicsCompressorNode.attack")}} {{readonlyInline}}
Is a {{k-rate}} {{domxref("AudioParam")}} representing the amount of time, in seconds, required to reduce the gain by 10 dB.
{{domxref("DynamicsCompressorNode.release")}} {{readonlyInline}}
Is a {{k-rate}} {{domxref("AudioParam")}} representing the amount of time, in seconds, required to increase the gain by 10 dB.

Methods

No specific methods; inherits methods from its parent, {{domxref("AudioNode")}}.

Example

{{page("/en-US/docs/Web/API/AudioContext.createDynamicsCompressor","Example")}}

Specifications

Specification Status Comment
{{SpecName('Web Audio API', '#DynamicsCompressorNode-section', 'DynamicsCompressorNode')}} {{Spec2('Web Audio API')}}  

Browser compatibility

{{CompatibilityTable}}
Feature Chrome Firefox (Gecko) Internet Explorer Opera Safari (WebKit)
Basic support {{CompatChrome(10.0)}}{{property_prefix("webkit")}} {{CompatGeckoDesktop(25.0)}}  {{CompatNo}} 15.0{{property_prefix("webkit")}}
22 (unprefixed)
6.0{{property_prefix("webkit")}}
Feature Android Firefox Mobile (Gecko) Firefox OS IE Mobile Opera Mobile Safari Mobile Chrome for Android
Basic support {{CompatUnknown}} 26.0 1.2 {{CompatUnknown}} {{CompatUnknown}} {{CompatUnknown}} 33.0

See also

Revision Source

<p>{{ APIRef("Web Audio API") }}</p>

<div>
<p>The <code>DynamicsCompressorNode</code> interface provides a compression effect, which lowers the volume of the loudest parts of the signal in order to help prevent clipping and distortion that can occur when multiple sounds are played and multiplexed together at once. This is often used in musical production and game audio. <code>DynamicsCompressorNode</code> is an {{domxref("AudioNode")}} that has exactly one input and one output; it is created using the {{domxref("AudioContext.createDynamicsCompressor")}} method.</p>
</div>

<table class="properties">
 <tbody>
  <tr>
   <th scope="row">Number of inputs</th>
   <td><code>1</code></td>
  </tr>
  <tr>
   <th scope="row">Number of outputs</th>
   <td><code>1</code></td>
  </tr>
  <tr>
   <th scope="row">Channel count mode</th>
   <td><code>"explicit"</code></td>
  </tr>
  <tr>
   <th scope="row">Channel count</th>
   <td><code>2</code></td>
  </tr>
  <tr>
   <th scope="row">Channel interpretation</th>
   <td><code>"speakers"</code></td>
  </tr>
 </tbody>
</table>

<h2 id="Properties">Properties</h2>

<p><em>Inherits properties from its parent, </em><em>{{domxref("AudioNode")}}</em>.</p>

<dl>
 <dt>{{domxref("DynamicsCompressorNode.threshold")}} {{readonlyInline}}</dt>
 <dd>Is a {{k-rate}} {{domxref("AudioParam")}} representing the decibel value above which the compression will start taking effect.</dd>
 <dt>{{domxref("DynamicsCompressorNode.knee")}} {{readonlyInline}}</dt>
 <dd>Is a {{k-rate}} {{domxref("AudioParam")}} containing a decibel value representing the range above the threshold where the curve smoothly transitions to the compressed portion.</dd>
 <dt>{{domxref("DynamicsCompressorNode.ratio")}} {{readonlyInline}}</dt>
 <dd>Is a {{k-rate}} {{domxref("AudioParam")}} representing the amount of change, in dB, needed in the input for a 1 dB change in the output.</dd>
 <dt>{{domxref("DynamicsCompressorNode.reduction")}} {{readonlyInline}}</dt>
 <dd>Is a <code>float </code>representing the amount of gain reduction currently applied by the compressor to the signal.</dd>
 <dt>{{domxref("DynamicsCompressorNode.attack")}} {{readonlyInline}}</dt>
 <dd>Is a {{k-rate}} {{domxref("AudioParam")}} representing the amount of time, in seconds, required to reduce the gain by 10 dB.</dd>
 <dt>{{domxref("DynamicsCompressorNode.release")}} {{readonlyInline}}</dt>
 <dd>Is a {{k-rate}} {{domxref("AudioParam")}} representing the amount of time, in seconds, required to increase the gain by 10 dB.</dd>
</dl>

<h2 id="Methods">Methods</h2>

<p><em>No specific methods; inherits methods from its parent, </em><em>{{domxref("AudioNode")}}</em>.</p>

<h2 id="Example">Example</h2>

<p>{{page("/en-US/docs/Web/API/AudioContext.createDynamicsCompressor","Example")}}</p>

<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', '#DynamicsCompressorNode-section', 'DynamicsCompressorNode')}}</td>
   <td>{{Spec2('Web Audio API')}}</td>
   <td>&nbsp;</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(10.0)}}{{property_prefix("webkit")}}</td>
   <td>{{CompatGeckoDesktop(25.0)}}&nbsp;</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="See_also">See also</h2>

<ul>
 <li><a href="/en-US/docs/Web_Audio_API/Using_Web_Audio_API">Using the Web Audio API</a></li>
</ul>
Revert to this revision