-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathaudio.js
33 lines (25 loc) · 835 Bytes
/
audio.js
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
/*
var listener = new THREE.AudioListener();
var sound = new THREE.Audio( listener );
var audioLoader = new THREE.AudioLoader();
audioLoader.load( " audio/BigCarTheft.MP3",
function( buffer ) {
sound.setBuffer( buffer );
sound.setLoop( true );
sound.setVolume( 0.5 );
});
*/
var BG_audio = new Audio("https://sapienzainteractivegraphicscourse.github.io/final-project-airplanes/audio/BigCarTheft.mp3");
function play(){
BG_audio.play();
//sound.play();
BG_audio.loop = true;
document.getElementById("playB").style.background = "#f52b2b";
document.getElementById("stopB").style.background = "#006680";
}
function stop_music(){
//sound.pause();
BG_audio.pause();
document.getElementById("playB").style.background = "#006680";
document.getElementById("stopB").style.background = "#f52b2b";
}