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
|
---
title: GainNode
slug: Web/API/GainNode
tags:
- API
- Experimental
- Reference
- Web Audio API
translation_of: Web/API/GainNode
---
<p>{{ APIRef("Web Audio API") }}</p>
<p>L'interface <strong><code>GainNode</code></strong> représente une variation de volume. Il s'agit d'un {{domxref("AudioNode")}}, c'est un module de traitement audio, qui provoque un gain donné à appliquer à des données d'entrée avant sa propagation à la sortie. Un <code>GainNode</code> a toujours exactement une entrée et une sortie, avec la même quantité de canaux.</p>
<p>Le gain est une valeur sans unité, qui change éventuellement avec le temps, qui est multiplié à chaque échantillon correspondant de tous les canaux entrées. En cas de modification, le nouveau gain est appliqué à l'aide d'un algorithme d'effilochage afin d'éviter aux «clics» inesthétiques d'apparaître dans l'audio résultant.</p>
<p><img alt="The GainNode is increasing the gain of the output." src="https://mdn.mozillademos.org/files/5085/WebAudioGainNode.png" style="height: 116px; width: 774px;"></p>
<table class="properties">
<tbody>
<tr>
<th scope="row"><dfn>Nombre d'entrées</dfn></th>
<td><code>1</code></td>
</tr>
<tr>
<th scope="row"><dfn>Nombre de sorties</dfn></th>
<td><code>1</code></td>
</tr>
<tr>
<th scope="row"><dfn>Mode de comptage des canaux</dfn></th>
<td><code>"max"</code></td>
</tr>
<tr>
<th scope="row"><dfn>Nombre de canaux</dfn></th>
<td><code>2</code> (inutilisés dans le mode de comptage par défaut)</td>
</tr>
<tr>
<th scope="row"><dfn>Interprétation des canaux</dfn></th>
<td><code>"speakers"</code></td>
</tr>
</tbody>
</table>
<h2 id="Constructeur">Constructeur</h2>
<dl>
<dt>{{domxref("GainNode.GainNode", "GainNode()")}}</dt>
<dd>Crée une nouvelle instance d'un objet <code>GainNode</code>. Il ne faut pas créer un noeud de gain manuellement, mais plutôt utiliser la méthode {{domxref("AudioContext.createGain()")}}.</dd>
</dl>
<h2 id="Propriétés">Propriétés</h2>
<p><em>Hérite des propritétés de son parent, </em><em>{{domxref("AudioNode")}}</em>.</p>
<dl>
<dt>{{domxref("GainNode.gain")}}</dt>
<dd>Est un <a href="/fr/docs/Web/API/AudioParam#a-rate">a-rate</a> {{domxref ("AudioParam")}} représentant le montant du gain à appliquer. (Bien que le <code>AudioParam</code> retournée est en lecture seule, la valeur qu'il représente ne l'est pas).</dd>
</dl>
<h2 id="Méthodes">Méthodes</h2>
<p>Aucune méthode spécifique; hérite des méthodes de son parent, {{domxref("AudioNode")}}.</p>
<h2 id="Exemple">Exemple</h2>
<p>{{page("/en-US/docs/Web/API/AudioContext.createGain","Example")}}</p>
<h2 id="Spécification">Spécification</h2>
<table class="standard-table">
<tbody>
<tr>
<th scope="col">Spécification</th>
<th scope="col">Statuts</th>
<th scope="col">Commentaire</th>
</tr>
<tr>
<td>{{SpecName('Web Audio API', '#GainNode-section', 'GainNode')}}</td>
<td>{{Spec2('Web Audio API')}}</td>
<td> </td>
</tr>
</tbody>
</table>
<h2 id="Compatibilité_navigateurs">Compatibilité navigateurs</h2>
<div>{{CompatibilityTable}}</div>
<div id="compat-desktop">
<table class="compat-table">
<tbody>
<tr>
<th>Fonctionnalité</th>
<th>Chrome</th>
<th>Edge</th>
<th>Firefox (Gecko)</th>
<th>Internet Explorer</th>
<th>Opera</th>
<th>Safari (WebKit)</th>
</tr>
<tr>
<td>Support basique</td>
<td>{{CompatChrome(10.0)}}{{property_prefix("webkit")}}</td>
<td>{{CompatVersionUnknown}}</td>
<td>{{CompatGeckoDesktop(25.0)}} </td>
<td>{{CompatNo}}</td>
<td>{{CompatOpera(15)}}{{property_prefix("webkit")}}<br>
{{CompatOpera(22)}}</td>
<td>6.0{{property_prefix("webkit")}}</td>
</tr>
<tr>
<td>constructeur</td>
<td>{{CompatChrome(55.0)}}</td>
<td>{{CompatVersionUnknown}}</td>
<td>{{CompatUnknown}}</td>
<td>{{CompatUnknown}}</td>
<td>{{CompatOpera(42)}}</td>
<td>{{CompatUnknown}}</td>
</tr>
</tbody>
</table>
</div>
<div id="compat-mobile">
<table class="compat-table">
<tbody>
<tr>
<th>Fonctionnalité</th>
<th>Android</th>
<th>Android Webview</th>
<th>Edge</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>Support basique</td>
<td>{{CompatNo}}</td>
<td>{{CompatVersionUnknown}}</td>
<td>{{CompatVersionUnknown}}</td>
<td>26.0</td>
<td>1.2</td>
<td>{{CompatUnknown}}</td>
<td>{{CompatVersionUnknown}}</td>
<td>{{CompatUnknown}}</td>
<td>{{CompatChrome(33.0)}}</td>
</tr>
<tr>
<td>constructeur</td>
<td>{{CompatNo}}</td>
<td>{{CompatChrome(55.0)}}</td>
<td>{{CompatVersionUnknown}}</td>
<td>{{CompatUnknown}}</td>
<td>{{CompatUnknown}}</td>
<td>{{CompatUnknown}}</td>
<td>{{CompatOpera(42)}}</td>
<td>{{CompatUnknown}}</td>
<td>{{CompatChrome(55.0)}}</td>
</tr>
</tbody>
</table>
</div>
<h2 id="Voir_aussi">Voir aussi</h2>
<ul>
<li><a href="https://developer.mozilla.org/en-US/docs/Web_Audio_API/Using_Web_Audio_API">Utiliser l'API Web Audio</a></li>
</ul>
|