OSDN Git Service

three.jsをThirdPartyに追加
[webglgame/webgl_framework.git] / webglFramework / Thirdparty / three.js-master / docs / api / audio / AudioListener.html
1 <!DOCTYPE html>
2 <html lang="en">
3         <head>
4                 <meta charset="utf-8" />
5                 <base href="../../" />
6                 <script src="list.js"></script>
7                 <script src="page.js"></script>
8                 <link type="text/css" rel="stylesheet" href="page.css" />
9         </head>
10         <body>
11                 [page:Object3D] &rarr;
12
13                 <h1>[name]</h1>
14
15                 <div class="desc">
16                         Create a non-positional ( global ) audio object.<br /><br />
17
18                         This uses the [link:https://developer.mozilla.org/en-US/docs/Web/API/Web_Audio_API Web Audio API].
19
20                 </div>
21
22
23                 <h2>Example</h2>
24
25                 <div>[example:misc_sound misc / sound ]</div>
26                 <code>
27                 //Create an AudioListener and add it to the camera
28                 var listener = new THREE.AudioListener();
29                 camera.add( listener );
30
31                 // create a global audio source
32                 var sound = new THREE.Audio( listener );
33
34                 var audioLoader = new THREE.AudioLoader();
35
36                 //Load a sound and set it as the Audio object's buffer
37                 audioLoader.load( 'sounds/ambient.ogg', function( buffer ) {
38                         sound.setBuffer( buffer );
39                         sound.setLoop(true);
40                         sound.setVolume(0.5);
41                         sound.play();
42                 });
43                 </code>
44
45
46                 <h2>Constructor</h2>
47
48
49                 <h3>[name](  )</h3>
50                 <div>
51                 Create a new AudioListener.
52                 </div>
53
54
55                 <h2>Properties</h2>
56
57                 <h3>[property:AudioContext context]</h3>
58                 <div>The [link:https://developer.mozilla.org/en-US/docs/Web/API/AudioContext AudioContext] of the [page:AudioListener listener] given in the constructor.</div>
59
60                 <h3>[property:GainNode gain]</h3>
61                 <div>A [link:https://developer.mozilla.org/en-US/docs/Web/API/GainNode GainNode] created
62                 using [link:https://developer.mozilla.org/en-US/docs/Web/API/AudioContext/createGain AudioContext.createGain]().</div>
63
64                 <h3>[property:AudioNode filter]</h3>
65                 <div>Default is *null*.</div>
66
67
68                 <h2>Methods</h2>
69
70
71                 <h3>[method:GainNode getInput]()</h3>
72                 <div>
73                 Return the [page:AudioListener.gain gainNode].
74                 </div>
75
76                 <h3>[method:null removeFilter]()</h3>
77                 <div>
78                 Set the [page:AudioListener.filter filter] property to *null*.
79                 </div>
80
81                 <h3>[method:AudioNode getFilter]()</h3>
82                 <div>
83                 Returns the value of the [page:AudioListener.filter filter] property.
84                 </div>
85
86                 <h3>[method:null setFilter]( [page:AudioNode value] )</h3>
87                 <div>
88                 Set the [page:AudioListener.filter filter] property to *value*.
89                 </div>
90
91                 <h3>[method:Number getMasterVolume]()</h3>
92                 <div>
93                 Return the volume.
94                 </div>
95
96                 <h3>[method:null setMasterVolume]( [page:Number value] )</h3>
97                 <div>
98                 Set the volume.
99                 </div>
100
101
102                 <h2>Source</h2>
103
104                 [link:https://github.com/mrdoob/three.js/blob/master/src/[path].js src/[path].js]
105         </body>
106 </html>