forked from mdn/content
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.html
62 lines (46 loc) · 1.67 KB
/
index.html
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
---
title: BaseAudioContext.destination
slug: Web/API/BaseAudioContext/destination
tags:
- API
- AudioContext
- BaseAudioContext
- Property
- Reference
- Web Audio API
- destination
browser-compat: api.BaseAudioContext.destination
---
<p>{{ APIRef("Web Audio API") }}</p>
<p>The <code>destination</code> property of the {{ domxref("BaseAudioContext") }}
interface returns an {{ domxref("AudioDestinationNode") }} representing the final
destination of all audio in the context. It often represents an actual audio-rendering
device such as your device's speakers.</p>
<h2 id="Syntax">Syntax</h2>
<pre class="brush: js">baseAudioContext.destination;
</pre>
<h3 id="Value">Value</h3>
<p>An {{ domxref("AudioDestinationNode") }}.</p>
<h2 id="Example">Example</h2>
<div class="note">
<p><strong>Note:</strong> for a full example implementation, see one of our Web Audio
Demos on the <a href="https://github.com/mdn/">MDN Github repo</a>, like <a
href="https://github.com/mdn/voice-change-o-matic">voice-change-o-matic</a>.</p>
</div>
<pre class="brush: js;">var AudioContext = window.AudioContext || window.webkitAudioContext;
var audioCtx = new AudioContext();
// Older webkit/blink browsers require a prefix
var oscillatorNode = audioCtx.createOscillator();
var gainNode = audioCtx.createGain();
oscillatorNode.connect(gainNode);
gainNode.connect(audioCtx.destination);
</pre>
<h2 id="Specifications">Specifications</h2>
{{Specifications}}
<h2 id="Browser_compatibility">Browser compatibility</h2>
<p>{{Compat}}</p>
<h2 id="See_also">See also</h2>
<ul>
<li><a href="/en-US/docs/Web/API/Web_Audio_API/Using_Web_Audio_API">Using the Web Audio API</a>
</li>
</ul>