aboutsummaryrefslogtreecommitdiff
path: root/files/pt-br/web/api/web_audio_api/index.html
blob: 14c6707eb4ccb1bbb5f2418db0f7c9a62cac6a26 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
---
title: API Web Áudio
slug: Web/API/Web_Audio_API
tags:
  - Web Audio API
  - api de áudio
  - áudio api
  - áudio web
translation_of: Web/API/Web_Audio_API
original_slug: Web/API/API_Web_Audio
---
<div class="summary">
<p>A API de áudio da web disponibiliza um poderoso e versátil sistema de controle de áudio para a Web, permitindo aos desenvolvedores escolher arquivos de áudio, adicionar efeitos a estes arquivos, criar reprodutores de áudio, aplicar <em>spatial effects</em> (como <em>panning</em>) e muito mais.</p>
</div>

<h2 id="Web_audio_conceitos_e_uso">Web audio: conceitos e uso</h2>

<p>A API de Web audio envolve manipulação de operações com áudio dentro de um <strong>contexto de áudio</strong>, e foi desenvolvida para permitir o <strong>roteamento</strong><strong> </strong><strong>modular</strong>. Operações básicas de áudio são feitas com <strong><em>audio nodes </em>(nós de áudio</strong>), que são ligados para formar <strong>gráficos de</strong><strong> roteamento </strong><strong>de áudio</strong>. Várias fontes - com diferentes tipos de <em>layout</em> de canal - são suportados mesmo em um único contexto. Este <em>design</em> modular permite flexibilidade para criar funções de áudio complexas com efeitos dinâmicos.</p>

<p><em>Audio nodes</em> são ligados pelas suas entradas e saídas, formando uma cadeia que começa com uma ou mais fontes, passa por um ou mais <em>nodes </em>e então acaba em um destino (embora você não tenha que fornecer um destino, por exemplo, se você quiser apenas visualizar alguns dados de áudio). Um fluxo de trabalho simples, com Web áudio, seria algo parecido com isso:</p>

<ol>
 <li>Crie um contexto de áudio</li>
 <li>Dentro do contexto, crie fontes de áudio — como <code>&lt;audio&gt;</code>, oscilador, <em>stream</em></li>
 <li>Crie efeitos de áudio, como <em>reverb</em>, <em>biquad filter</em>, <em>panner</em>, <em>compressor</em></li>
 <li>Escolha o destino final de áudio, por exemplo os auto-falantes de seu sistema</li>
 <li>Conecte as fontes de áudio com os efeitos, e os efeitos com o destino.</li>
</ol>

<p><img alt="A simple box diagram with an outer box labeled Audio context, and three inner boxes labeled Sources, Effects and Destination. The three inner boxes have arrow between them pointing from left to right, indicating the flow of audio information." src="https://mdn.mozillademos.org/files/7893/web-audio-api-flowchart.png" style="display: block; height: 113px; margin: 0px auto; width: 635px;"></p>

<p>O sincronismo é controlado com alta precisão e baixa latência, permitindo aos desenvolvedores escrever códigos que respondam com precisão a eventos e capazes de gerar exemplos específicos, mesmo com uma alta taxa de amostragem. Dessa forma, aplicações como baterias eletrônicas e seqüenciadores estarão facilmente ao alcance dos desenvolvedores.</p>

<p>A API de Web Audio também permite o controle de como o áudio será ordenado. Usando um sistema baseado em um modelo de<em> source-listener</em>, a API permite controlar os painéis de<em> modelo</em> para serem usados e tratados com atenuação de distância induzida ou <em>doppler shift</em> induzido por uma fonte em movimento (ou um ouvinte em movimento).</p>

<div class="note">
<p><strong>Nota</strong>: Você pode ver mais detalhes sobre a teoria da API de Web Audio em nosso artigo <a href="/en-US/docs/Web/API/Web_Audio_API/Basic_concepts_behind_Web_Audio_API">Basic concepts behind Web Audio API</a>.</p>
</div>

<h2 id="Web_Audio_Interfaces_da_API">Web Audio: Interfaces da API</h2>

<p>A API de Web Audio possui um total de 28 interfaces e eventos associados, que nós dividimos e categorizamos em 9 funcionalidades.</p>

<h3 id="Definições_gerais_de_grafos_de_áudio_(audio_graph)">Definições gerais de grafos de áudio (audio graph)</h3>

<p>Definições gerais que moldam os grafos de áudio no uso da API de Web Audio.</p>

<dl>
 <dt>{{domxref("AudioContext")}}</dt>
 <dd>A interface <strong><code>AudioContext</code></strong> representa um grafo de processamento de áudio construído a partir de módulos de áudio ligados entre si, cada um representado por um {{domxref("AudioNode")}}. Um contexto de áudio (audio context) controla a criação dos<em>nós </em>que ele contém e a execução do processamento de áudio, ou a decodificação. Como tudo acontece dentro de um contexto, você deve criar um <code><strong>AudioContext</strong></code> antes de fazer qualquer outra coisa.</dd>
 <dt>{{domxref("AudioNode")}}</dt>
 <dd>A interface <code><strong>AudioNode</strong></code> representa um módulo de processamento de áudio como uma fonte de áudio (por exemplo, um HTML {{HTMLElement("áudio")}} ou um elemento {{HTMLElement("vídeo")}}), destino de áudio, módulo de processamento intermediário (por exemplo, um filtro como {{domxref("BiquadFilterNode")}}, ou controle de volume, como {{domxref("GainNode")}}).</dd>
 <dt>{{domxref("AudioParam")}}</dt>
 <dd>A interface <code><strong>AudioParam</strong></code> representa um parâmetro relacionado ao áudio, como um parâmetro de um {{domxref("AudioNode")}}. Ele pode ser configurado com um valor específico ou uma mudança de valor, e pode ser programado para "acontecer" em um momento específico e seguindo um padrão específico.</dd>
 <dt>{{event("ended_(Web_Audio)", "ended")}} (event)</dt>
 <dd>O evento <code>ended</code> é disparado quando a reprodução parou porque o fim da mídia foi atingido.</dd>
</dl>

<h3 id="Definindo_fontes_de_áudio">Definindo fontes de áudio</h3>

<p>Interfaces que definem fontes de áudio para uso na API de Web Audio.</p>

<dl>
 <dt>{{domxref("OscillatorNode")}}</dt>
 <dd>A interface <strong><code>OscillatorNode</code></strong> representa uma onda senoidal. Esta interface é um módulo de processamento de áudio que gera uma onda senoidal com determinada frequência.</dd>
 <dt>{{domxref("AudioBuffer")}}</dt>
 <dd>A interface <strong><code>AudioBuffer</code></strong> representa uma pequena porção de áudio armazenada na memória, criada a partir de um arquivo de áudio usando o método {{ domxref("AudioContext.decodeAudioData()") }}, ou criado com os dados brutos usando o método {{ domxref("AudioContext.createBuffer()") }}. Uma vez decodificado neste formato o áudio pode ser colocada em um {{ domxref("AudioBufferSourceNode") }}.</dd>
 <dt>{{domxref("AudioBufferSourceNode")}}</dt>
 <dd>A interface AudioBufferSourceNode representa uma fonte de áudio que consiste em dados de áudio na memória, armazenados em um {{domxref ("AudioBuffer")}}. É um {{domxref ("AudioNode")}} que atua como uma fonte de áudio.</dd>
 <dt>{{domxref("MediaElementAudioSourceNode")}}</dt>
 <dd>A interface <code><strong>MediaElementAudio</strong></code><strong><code>SourceNode</code></strong>  representa uma fonte de audio consiste de um HTML5 {{ htmlelement("audio") }} ou {{ htmlelement("video") }} elemento. É uma {{domxref("AudioNode")}} que atua como uma fonte de áudio.</dd>
 <dt>{{domxref("MediaStreamAudioSourceNode")}}</dt>
 <dd>The <code><strong>MediaStreamAudio</strong></code><strong><code>SourceNode</code></strong> interface represents an audio source consisting of a <a href="/en-US/docs/WebRTC" title="/en-US/docs/WebRTC">WebRTC</a> {{domxref("MediaStream")}} (such as a webcam or microphone.) It is an {{domxref("AudioNode")}} that acts as an audio source.</dd>
</dl>

<h3 id="Definindo_filtros_de_efeitos_de_áudio">Definindo filtros de efeitos de áudio</h3>

<p>Interfaces para definição de efeitos que você deseja aplicar em suas fontes de áudio.</p>

<dl>
 <dt>{{domxref("BiquadFilterNode")}}</dt>
 <dd>The <strong><code>BiquadFilterNode</code></strong><strong> </strong>interface represents a simple low-order filter. It is an {{domxref("AudioNode")}} that can represent different kinds of filters, tone control devices or graphic equalizers. A <code>BiquadFilterNode</code> always has exactly one input and one output.</dd>
 <dt>{{domxref("ConvolverNode")}}</dt>
 <dd>The <code><strong>Convolver</strong></code><strong><code>Node</code></strong><strong> </strong>interface is an {{domxref("AudioNode")}} that performs a Linear Convolution on a given AudioBuffer, often used to achieve a reverb effect.</dd>
 <dt>{{domxref("DelayNode")}}</dt>
 <dd>The <strong><code>DelayNode</code></strong><strong> </strong>interface represents a <a href="http://en.wikipedia.org/wiki/Digital_delay_line">delay-line</a>; an {{domxref("AudioNode")}} audio-processing module that causes a delay between the arrival of an input data and its propagation to the output.</dd>
 <dt>{{domxref("DynamicsCompressorNode")}}</dt>
 <dd>The <strong><code>DynamicsCompressorNode</code></strong> 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.</dd>
 <dt>{{domxref("GainNode")}}</dt>
 <dd>The <strong><code>GainNode</code></strong><strong> </strong>interface represents a change in volume. It is an {{domxref("AudioNode")}} audio-processing module that causes a given <em>gain</em> to be applied to the input data before its propagation to the output.</dd>
 <dt>{{domxref("WaveShaperNode")}}</dt>
 <dd>The <strong><code>WaveShaperNode</code></strong><strong> </strong>interface represents a non-linear distorter. It is an {{domxref("AudioNode")}} that use a curve to apply a waveshaping distortion to the signal. Beside obvious distortion effects, it is often used to add a warm feeling to the signal.</dd>
 <dt>{{domxref("PeriodicWave")}}</dt>
 <dd>Used to define a periodic waveform that can be used to shape the output of an {{ domxref("OscillatorNode") }}.</dd>
</dl>

<h3 id="Definindo_destinos_de_áudio">Definindo destinos de áudio</h3>

<p>Uma vez que você tenha feito o processamento do seu áudio, estas interfaces definirão aonde será a saída do áudio.</p>

<dl>
 <dt>{{domxref("AudioDestinationNode")}}</dt>
 <dd>The <strong><code>AudioDestinationNode</code></strong> interface represents the end destination of an audio source in a given context — usually the speakers of your device.</dd>
 <dt>{{domxref("MediaStreamAudioDestinationNode")}}</dt>
 <dd>The <code><strong>MediaElementAudio</strong></code><strong><code>SourceNode</code></strong> interface represents an audio destination consisting of a <a href="/en-US/docs/WebRTC" title="/en-US/docs/WebRTC">WebRTC</a> {{domxref("MediaStream")}} with a single <code>AudioMediaStreamTrack</code>, which can be used in a similar way to a MediaStream obtained from {{ domxref("Navigator.getUserMedia") }}. It is an {{domxref("AudioNode")}} that acts as an audio destination.</dd>
</dl>

<h3 id="Análise_dos_dados_e_visualização">Análise dos dados e visualização</h3>

<p>Se você deseja extrair tempo, frequencia e outras informações do seu áudio, o <code>AnalyserNode</code> é o que você necessita.</p>

<dl>
 <dt>{{domxref("AnalyserNode")}}</dt>
 <dd>The <strong><code>AnalyserNode</code></strong> interface represents a node able to provide real-time frequency and time-domain analysis information, for the purposes of data analysis and visualization.</dd>
</dl>

<h3 id="Dividindo_e_mesclando_canais_de_áudio">Dividindo e mesclando canais de áudio</h3>

<p>Para dividir e mesclar canais de áudio, você utilizará essas interfaces.</p>

<dl>
 <dt>{{domxref("ChannelSplitterNode")}}</dt>
 <dd>The <code><strong>ChannelSplitterNode</strong></code> interface separates the different channels of an audio source out into a set of <em>mono</em> outputs.</dd>
 <dt>{{domxref("ChannelMergerNode")}}</dt>
 <dd>The <code><strong>ChannelMergerNode</strong></code> interface reunites different mono inputs into a single outputs. Each input will be used to fill a channel of the output.</dd>
</dl>

<h3 id="Audio_spatialization">Audio spatialization</h3>

<p>These interfaces allow you to add audio spatialization panning effects to your audio sources.</p>

<dl>
 <dt>{{domxref("AudioListener")}}</dt>
 <dd>The <strong><code>AudioListener</code></strong><strong> </strong>interface represents the position and orientation of the unique person listening to the audio scene used in audio spatialization.</dd>
 <dt>{{domxref("PannerNode")}}</dt>
 <dd>The <strong><code>PannerNode</code></strong><strong> </strong>interface represents the behavior of a signal in space. It is an {{domxref("AudioNode")}} audio-processing module describing its position with right-hand Cartesian coordinates, its movement using a velocity vector and its directionality using a directionality cone.</dd>
</dl>

<h3 id="Processamento_de_áudio_por_JavaScript">Processamento de áudio por JavaScript</h3>

<p>Se você quiser usar um <em>script</em> externo para processar sua fonte de áudio, Node e eventos abaixo tornarão isto possível.</p>

<dl>
 <dt>{{domxref("ScriptProcessorNode")}}</dt>
 <dd>The <strong><code>ScriptProcessorNode</code></strong><strong> </strong>interface allows the generation, processing, or analyzing of audio using JavaScript. It is an {{domxref("AudioNode")}} audio-processing module that is linked to two buffers, one containing the current input, one containing the output. An event, implementing the {{domxref("AudioProcessingEvent")}} interface, is sent to the object each time the input buffer contains new data, and the event handler terminates when it has filled the output buffer with data.</dd>
 <dt>{{event("audioprocess")}} (event)</dt>
 <dd>The <code>audioprocess</code> event is fired when an input buffer of a Web Audio API {{domxref("ScriptProcessorNode")}} is ready to be processed.</dd>
 <dt>{{domxref("AudioProcessingEvent")}}</dt>
 <dd>The <a href="/en-US/docs/Web_Audio_API" title="/en-US/docs/Web_Audio_API">Web Audio API</a> <code>AudioProcessingEvent</code> represents events that occur when a {{domxref("ScriptProcessorNode")}} input buffer is ready to be processed.</dd>
</dl>

<h3 id="Áudio_offline">Áudio <em>offline</em></h3>

<p>Manipular áudio <em>offline </em>é possível com estas interfaces.</p>

<dl>
 <dt>{{domxref("OfflineAudioContext")}}</dt>
 <dd>The <strong><code>OfflineAudioContext</code></strong> interface is an {{domxref("AudioContext")}} interface representing an audio-processing graph built from linked together {{domxref("AudioNode")}}s. In contrast with a standard <code>AudioContext</code>, an <code>OfflineAudioContext</code> doesn't really render the audio but rather generates it, <em>as fast as it can</em>, in a buffer.</dd>
 <dt>{{event("complete")}} (event)</dt>
 <dd>The <code>complete</code> event is fired when the rendering of an {{domxref("OfflineAudioContext")}} is terminated.</dd>
 <dt>{{domxref("OfflineAudioCompletionEvent")}}</dt>
 <dd>The <code>OfflineAudioCompletionEvent</code> represents events that occur when the processing of an {{domxref("OfflineAudioContext")}} is terminated. The {{event("complete")}} event implements this interface.</dd>
</dl>

<h2 id="Interfaces_obsoletas">Interfaces obsoletas</h2>

<p>As interfaces a seguir foram definidas em versões antigas das especificações da API de Web Audio, mas agora elas estão obsoletas e serão substituidas por outras interfaces.</p>

<dl>
 <dt>{{domxref("JavaScriptNode")}}</dt>
 <dd>Used for direct audio processing via JavaScript. This interface is obsolete, and has been replaced by {{domxref("ScriptProcessorNode")}}.</dd>
 <dt>{{domxref("WaveTableNode")}}</dt>
 <dd>Used to define a periodic waveform. This interface is obsolete, and has been replaced by {{domxref("PeriodicWave")}}.</dd>
</dl>

<h2 id="Exemplo">Exemplo</h2>

<p>Este exemplo mostra uma grande variedade de funções da API de Web Audio que podem ser utilizadas. Você pode ver este código em ação na demo <a href="http://mdn.github.io/voice-change-o-matic/">Voice-change-o-matic</a> (também verificar o <a href="https://github.com/mdn/voice-change-o-matic">código-fonte completo no Github</a>) - esta é uma demonstração de um modificador de voz de brinquedo experimental; aconselhamos manter seus alto-falantes baixo ao utilizá-lo, pelo menos para começar!</p>

<p>As linhas API de Web Audio estão destacadas; se você quiser encontrar mais informações sobre os diferentes métodos, faça uma busca através das páginas de referência.</p>

<pre class="brush: js; highlight:[1,2,9,10,11,12,36,37,38,39,40,41,62,63,72,114,115,121,123,124,125,147,151]">var audioCtx = new (window.AudioContext || window.webkitAudioContext)(); // define audio context
// Webkit/blink browsers need prefix, Safari won't work without window.

var voiceSelect = document.getElementById("voice"); // select box for selecting voice effect options
var visualSelect = document.getElementById("visual"); // select box for selecting audio visualization options
var mute = document.querySelector('.mute'); // mute button
var drawVisual; // requestAnimationFrame

var analyser = audioCtx.createAnalyser();
var distortion = audioCtx.createWaveShaper();
var gainNode = audioCtx.createGain();
var biquadFilter = audioCtx.createBiquadFilter();

function makeDistortionCurve(amount) { // function to make curve shape for distortion/wave shaper node to use
  var k = typeof amount === 'number' ? amount : 50,
    n_samples = 44100,
    curve = new Float32Array(n_samples),
    deg = Math.PI / 180,
    i = 0,
    x;
  for ( ; i &lt; n_samples; ++i ) {
    x = i * 2 / n_samples - 1;
    curve[i] = ( 3 + k ) * x * 20 * deg / ( Math.PI + k * Math.abs(x) );
  }
  return curve;
};

navigator.getUserMedia (
  // constraints - only audio needed for this app
  {
    audio: true
  },

  // Success callback
  function(stream) {
    source = audioCtx.createMediaStreamSource(stream);
    source.connect(analyser);
    analyser.connect(distortion);
    distortion.connect(biquadFilter);
    biquadFilter.connect(gainNode);
    gainNode.connect(audioCtx.destination); // connecting the different audio graph nodes together

    visualize(stream);
    voiceChange();

  },

  // Error callback
  function(err) {
    console.log('The following gUM error occured: ' + err);
  }
);

function visualize(stream) {
  WIDTH = canvas.width;
  HEIGHT = canvas.height;

  var visualSetting = visualSelect.value;
  console.log(visualSetting);

  if(visualSetting == "sinewave") {
    analyser.fftSize = 2048;
    var bufferLength = analyser.frequencyBinCount; // half the FFT value
    var dataArray = new Uint8Array(bufferLength); // create an array to store the data

    canvasCtx.clearRect(0, 0, WIDTH, HEIGHT);

    function draw() {

      drawVisual = requestAnimationFrame(draw);

      analyser.getByteTimeDomainData(dataArray); // get waveform data and put it into the array created above

      canvasCtx.fillStyle = 'rgb(200, 200, 200)'; // draw wave with canvas
      canvasCtx.fillRect(0, 0, WIDTH, HEIGHT);

      canvasCtx.lineWidth = 2;
      canvasCtx.strokeStyle = 'rgb(0, 0, 0)';

      canvasCtx.beginPath();

      var sliceWidth = WIDTH * 1.0 / bufferLength;
      var x = 0;

      for(var i = 0; i &lt; bufferLength; i++) {

        var v = dataArray[i] / 128.0;
        var y = v * HEIGHT/2;

        if(i === 0) {
          canvasCtx.moveTo(x, y);
        } else {
          canvasCtx.lineTo(x, y);
        }

        x += sliceWidth;
      }

      canvasCtx.lineTo(canvas.width, canvas.height/2);
      canvasCtx.stroke();
    };

    draw();

  } else if(visualSetting == "off") {
    canvasCtx.clearRect(0, 0, WIDTH, HEIGHT);
    canvasCtx.fillStyle = "red";
    canvasCtx.fillRect(0, 0, WIDTH, HEIGHT);
  }

}

function voiceChange() {
  distortion.curve = new Float32Array;
  biquadFilter.gain.value = 0; // reset the effects each time the voiceChange function is run

  var voiceSetting = voiceSelect.value;
  console.log(voiceSetting);

  if(voiceSetting == "distortion") {
    distortion.curve = makeDistortionCurve(400); // apply distortion to sound using waveshaper node
  } else if(voiceSetting == "biquad") {
    biquadFilter.type = "lowshelf";
    biquadFilter.frequency.value = 1000;
    biquadFilter.gain.value = 25; // apply lowshelf filter to sounds using biquad
  } else if(voiceSetting == "off") {
    console.log("Voice settings turned off"); // do nothing, as off option was chosen
  }

}

// event listeners to change visualize and voice settings

visualSelect.onchange = function() {
  window.cancelAnimationFrame(drawVisual);
  visualize(stream);
}

voiceSelect.onchange = function() {
  voiceChange();
}

mute.onclick = voiceMute;

function voiceMute() { // toggle to mute and unmute sound
  if(mute.id == "") {
    gainNode.gain.value = 0; // gain set to 0 to mute sound
    mute.id = "activated";
    mute.innerHTML = "Unmute";
  } else {
    gainNode.gain.value = 1; // gain set to 1 to unmute sound
    mute.id = "";
    mute.innerHTML = "Mute";
  }
}
</pre>

<h2 id="Especificações">Especificações</h2>

<table class="standard-table">
 <tbody>
  <tr>
   <th scope="col">Especificação</th>
   <th scope="col">Status</th>
   <th scope="col">Comentário</th>
  </tr>
  <tr>
   <td>{{SpecName('Web Audio API')}}</td>
   <td>{{Spec2('Web Audio API')}}</td>
   <td> </td>
  </tr>
 </tbody>
</table>

<h2 id="Browser_compatibility">Compatibilidade com navegadores</h2>

<div>{{CompatibilityTable}}</div>

<div>
<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>14 {{property_prefix("webkit")}}</td>
   <td>23</td>
   <td>{{CompatNo}}</td>
   <td>15 {{property_prefix("webkit")}}<br>
    22 (unprefixed)</td>
   <td>6 {{property_prefix("webkit")}}</td>
  </tr>
 </tbody>
</table>
</div>

<div>
<table class="compat-table">
 <tbody>
  <tr>
   <th>Feature</th>
   <th>Android</th>
   <th>Chrome</th>
   <th>Firefox Mobile (Gecko)</th>
   <th>Firefox OS</th>
   <th>IE Phone</th>
   <th>Opera Mobile</th>
   <th>Safari Mobile</th>
  </tr>
  <tr>
   <td>Basic support</td>
   <td>{{CompatNo}}</td>
   <td>28 {{property_prefix("webkit")}}</td>
   <td>25</td>
   <td>1.2</td>
   <td>{{CompatNo}}</td>
   <td>{{CompatNo}}</td>
   <td>6 {{property_prefix("webkit")}}</td>
  </tr>
 </tbody>
</table>
</div>

<h2 id="sect1"> </h2>

<h2 id="Veja_também">Veja também</h2>

<ul>
 <li><a href="/en-US/docs/Web/API/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/Visualizations_with_Web_Audio_API">Visualizations with Web Audio API</a></li>
 <li><a href="http://mdn.github.io/voice-change-o-matic/">Voice-change-O-matic example</a></li>
 <li><a href="http://mdn.github.io/violent-theremin/">Violent Theremin example</a></li>
 <li><a href="/en-US/docs/Web/API/Web_Audio_API/Web_audio_spatialisation_basics">Web audio spatialisation basics</a></li>
 <li><a href="http://www.html5rocks.com/tutorials/webaudio/positional_audio/">Mixing Positional Audio and WebGL</a></li>
 <li><a href="http://www.html5rocks.com/tutorials/webaudio/games/">Developing Game Audio with the Web Audio API</a></li>
 <li><a href="/en-US/docs/Web/API/Web_Audio_API/Porting_webkitAudioContext_code_to_standards_based_AudioContext" title="/en-US/docs/Web_Audio_API/Porting_webkitAudioContext_code_to_standards_based_AudioContext">Porting webkitAudioContext code to standards based AudioContext</a></li>
 <li><a href="https://github.com/bit101/tones">Tones</a>: a simple library for playing specific tones/notes using the Web Audio API.</li>
</ul>

<section id="Quick_links">
<h3 id="Quicklinks">Quicklinks</h3>

<ol>
 <li data-default-state="open"><strong><a href="#">Guides</a></strong>

  <ol>
   <li><a href="/en-US/docs/Web/API/Web_Audio_API/Basic_concepts_behind_Web_Audio_API">Basic concepts behind Web Audio API</a></li>
   <li><a href="/en-US/docs/Web/API/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/Visualizations_with_Web_Audio_API">Visualizations with Web Audio API</a></li>
   <li><a href="/en-US/docs/Web/API/Web_Audio_API/Web_audio_spatialisation_basics">Web audio spatialisation basics</a></li>
   <li><a href="/en-US/docs/Web/API/Web_Audio_API/Porting_webkitAudioContext_code_to_standards_based_AudioContext" title="/en-US/docs/Web_Audio_API/Porting_webkitAudioContext_code_to_standards_based_AudioContext">Porting webkitAudioContext code to standards based AudioContext</a></li>
  </ol>
 </li>
 <li data-default-state="open"><strong><a href="#">Examples</a></strong>
  <ol>
   <li><a href="http://mdn.github.io/voice-change-o-matic/">Voice-change-O-matic</a></li>
   <li><a href="http://mdn.github.io/violent-theremin/">Violent Theremin</a></li>
  </ol>
 </li>
 <li data-default-state="open"><strong><a href="#">Interfaces</a></strong>
  <ol>
   <li>{{domxref("AnalyserNode")}}</li>
   <li>{{domxref("AudioBuffer")}}</li>
   <li>{{domxref("AudioBufferSourceNode")}}</li>
   <li>{{domxref("AudioContext")}}</li>
   <li>{{domxref("AudioDestinationNode")}}</li>
   <li>{{domxref("AudioListener")}}</li>
   <li>{{domxref("AudioNode")}}</li>
   <li>{{domxref("AudioParam")}}</li>
   <li>{{event("audioprocess")}} (event)</li>
   <li>{{domxref("AudioProcessingEvent")}}</li>
   <li>{{domxref("BiquadFilterNode")}}</li>
   <li>{{domxref("ChannelMergerNode")}}</li>
   <li>{{domxref("ChannelSplitterNode")}}</li>
   <li>{{event("complete")}} (event)</li>
   <li>{{domxref("ConvolverNode")}}</li>
   <li>{{domxref("DelayNode")}}</li>
   <li>{{domxref("DynamicsCompressorNode")}}</li>
   <li>{{event("ended_(Web_Audio)", "ended")}} (event)</li>
   <li>{{domxref("GainNode")}}</li>
   <li>{{domxref("MediaElementAudioSourceNode")}}</li>
   <li>{{domxref("MediaStreamAudioDestinationNode")}}</li>
   <li>{{domxref("MediaStreamAudioSourceNode")}}</li>
   <li>{{domxref("OfflineAudioCompletionEvent")}}</li>
   <li>{{domxref("OfflineAudioContext")}}</li>
   <li>{{domxref("OscillatorNode")}}</li>
   <li>{{domxref("PannerNode")}}</li>
   <li>{{domxref("PeriodicWaveNode")}}</li>
   <li>{{domxref("ScriptProcessorNode")}}</li>
   <li>{{domxref("WaveShaperNode")}}</li>
  </ol>
 </li>
</ol>
</section>