Click here to Skip to main content
15,886,422 members
Please Sign up or sign in to vote.
1.00/5 (2 votes)
See more:
JavaScript
var mesh1 = new THREE.Mesh( new THREE.BoxGeometry(2,2,2),new THREE.MeshBasicMaterial());
 mesh1.position.set( 0, -100, 0 );
 SCENE.add( mesh1 );

 var sound1 = new THREE.Audio( AudioListener );
 sound1.load( 'sounds/Soundtrak.ogg' );
 sound1.setRefDistance( 2000 );
 sound1.loop = true;
 sound1.autoplay = true;
 mesh1.add( sound1 );



This code plays sound only ones. How make sound loop playing?
I did like in example: http://threejs.org/examples/#misc_sound
But sound plays once then stop.
Please help. Cheers.
Posted

1 solution

sound1.setLoop(true);

I have the opposite problem
setLoop(false) does not work - it loops and loops and loops 🙄
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900