You can not select more than 25 topics
			Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
		
		
		
		
		
			
		
			
				
					
					
						
							136 lines
						
					
					
						
							4.1 KiB
						
					
					
				
			
		
		
		
			
			
			
				
					
				
				
					
				
			
		
		
	
	
							136 lines
						
					
					
						
							4.1 KiB
						
					
					
				| <!DOCTYPE html> | |
| <html lang="ko"> | |
| 	<head> | |
| 		<meta charset="utf-8" /> | |
| 		<base href="../../../" /> | |
| 		<script src="page.js"></script> | |
| 		<link type="text/css" rel="stylesheet" href="page.css" /> | |
| 	</head> | |
| 	<body> | |
| 		[page:Object3D] → [page:Audio] → | |
| 
 | |
| 		<h1>[name]</h1> | |
| 
 | |
| 		<p class="desc"> | |
| 			지정 오디오 오브젝트를 생성합니다.<br /><br /> | |
| 
 | |
| 			[link:https://developer.mozilla.org/en-US/docs/Web/API/Web_Audio_API Web Audio API]를 사용합니다. | |
| 		</p> | |
| 
 | |
| 		<h2>코드 예제</h2> | |
| 
 | |
| 		<code> | |
| 		// create an AudioListener and add it to the camera | |
| 		const listener = new THREE.AudioListener(); | |
| 		camera.add( listener ); | |
| 
 | |
| 		// create the PositionalAudio object (passing in the listener) | |
| 		const sound = new THREE.PositionalAudio( listener ); | |
| 
 | |
| 		// load a sound and set it as the PositionalAudio object's buffer | |
| 		const audioLoader = new THREE.AudioLoader(); | |
| 		audioLoader.load( 'sounds/song.ogg', function( buffer ) { | |
| 			sound.setBuffer( buffer ); | |
| 			sound.setRefDistance( 20 ); | |
| 			sound.play(); | |
| 		}); | |
| 
 | |
| 		// create an object for the sound to play from | |
| 		const sphere = new THREE.SphereGeometry( 20, 32, 16 ); | |
| 		const material = new THREE.MeshPhongMaterial( { color: 0xff2200 } ); | |
| 		const mesh = new THREE.Mesh( sphere, material ); | |
| 		scene.add( mesh ); | |
| 
 | |
| 		// finally add the sound to the mesh | |
| 		mesh.add( sound ); | |
| 		</code> | |
| 
 | |
| 		<h2>예제</h2> | |
| 
 | |
| 		<p> | |
| 			[example:webaudio_orientation webaudio / orientation ]<br /> | |
| 			[example:webaudio_sandbox webaudio / sandbox ]<br /> | |
| 			[example:webaudio_timing webaudio / timing ] | |
| 		</p> | |
| 
 | |
| 		<h2>생성자</h2> | |
| 
 | |
| 		<h3>[name]( [param:AudioListener listener] )</h3> | |
| 		<p> | |
| 		리스너 — (필수) [page:AudioListener AudioListener] 인스턴스. | |
| 		</p> | |
| 
 | |
| 
 | |
| 		<h2>프로퍼티</h2> | |
| 
 | |
| 		<p> | |
| 			상속받은 프로퍼티는 [page:Audio Audio] 클래스를 참고하세요. | |
| 		</p> | |
| 
 | |
| 		<h3>[property:PannerNode panner]</h3> | |
| 		<p>PositionalAudio의 [link:https://developer.mozilla.org/en-US/docs/Web/API/PannerNode PannerNode].</p> | |
| 
 | |
| 
 | |
| 		<h2>메서드</h2> | |
| 
 | |
| 		<p> | |
| 			상속받은 메서드는 [page:Audio Audio] 클래스를 참고하세요. | |
| 		</p> | |
| 
 | |
| 		<h3>[method:PannerNode getOutput]()</h3> | |
| 		<p> | |
| 		[page:PositionalAudio.panner panner]를 리턴합니다. | |
| 		</p> | |
| 
 | |
| 		<h3>[method:Float getRefDistance]()</h3> | |
| 		<p> | |
| 		[link:https://developer.mozilla.org/en-US/docs/Web/API/PannerNode/refDistance panner.refDistance]의 값을 리턴합니다. | |
| 		</p> | |
| 
 | |
| 		<h3>[method:this setRefDistance]( [param:Float value] )</h3> | |
| 		<p> | |
| 		[link:https://developer.mozilla.org/en-US/docs/Web/API/PannerNode/refDistance panner.refDistance]의 값을 설정합니다. | |
| 		</p> | |
| 
 | |
| 		<h3>[method:Float getRolloffFactor]()</h3> | |
| 		<p> | |
| 		[link:https://developer.mozilla.org/en-US/docs/Web/API/PannerNode/rolloffFactor panner.rolloffFactor]의 값을 리턴합니다. | |
| 		</p> | |
| 
 | |
| 		<h3>[method:this setRolloffFactor]( [param:Float value] )</h3> | |
| 		<p> | |
| 		[link:https://developer.mozilla.org/en-US/docs/Web/API/PannerNode/rolloffFactor panner.rolloffFactor]의 값을 설정합니다. | |
| 		</p> | |
| 
 | |
| 		<h3>[method:String getDistanceModel]()</h3> | |
| 		<p> | |
| 		[link:https://developer.mozilla.org/en-US/docs/Web/API/PannerNode/distanceModel panner.distanceModel]의 값을 리턴합니다. | |
| 		</p> | |
| 
 | |
| 		<h3>[method:this setDistanceModel]( [param:String value] )</h3> | |
| 		<p> | |
| 		[link:https://developer.mozilla.org/en-US/docs/Web/API/PannerNode/distanceModel panner.distanceModel]의 값을 설정합니다. | |
| 		</p> | |
| 
 | |
| 		<h3>[method:Float getMaxDistance]()</h3> | |
| 		<p> | |
| 		[link:https://developer.mozilla.org/en-US/docs/Web/API/PannerNode/maxDistance panner.maxDistance]의 값을 리턴합니다. | |
| 		</p> | |
| 
 | |
| 		<h3>[method:this setMaxDistance]( [param:Float value] )</h3> | |
| 		<p> | |
| 		[link:https://developer.mozilla.org/en-US/docs/Web/API/PannerNode/maxDistance panner.maxDistance]의 값을 리턴합니다. | |
| 		</p> | |
| 
 | |
| 		<h3>[method:this setDirectionalCone]( [param:Float coneInnerAngle], [param:Float coneOuterAngle], [param:Float coneOuterGain] )</h3> | |
| 		<p> | |
| 		이 메서드는 전방향 사운드를 [link:https://developer.mozilla.org/en-US/docs/Web/API/PannerNode directional sound]로 변환하기 위해 사용할 수 있습니다. | |
| 		</p> | |
| 
 | |
| 		<h2>소스 코드</h2> | |
| 
 | |
| 		<p> | |
| 			[link:https://github.com/mrdoob/three.js/blob/master/src/[path].js src/[path].js] | |
| 		</p> | |
| 	</body> | |
| </html>
 | |
| 
 |