diff options
-rw-r--r-- | tape-deck.js | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/tape-deck.js b/tape-deck.js index e0ee376..7485c92 100644 --- a/tape-deck.js +++ b/tape-deck.js @@ -3,7 +3,9 @@ const currentSide = urlParams.get("side"); const tape = new Audio(`audio/2019-mix-side-${currentSide}.mp3`); const pressPlaySound = new Audio("audio/tape-start.mp3"); +const buttonPressSound = new Audio("audio/button-press.mp3"); pressPlaySound.onended = (event) => { tape.play(); }; +buttonPressSound.onended = (event) => { tape.play(); }; const stopImage = "images/cool-deck.png"; const playImage = "images/cool-deck.gif"; @@ -11,7 +13,6 @@ const playImage = "images/cool-deck.gif"; let playButton = document.getElementById("play-button"); const playButtonUp = "images/play-button-up.png"; const playButtonDown = "images/play-button-down.png"; -const buttonPressSound = new Audio("audio/button-press.mp3"); let deck = document.getElementById("tape-deck"); let notes = document.getElementById("notes"); @@ -43,7 +44,6 @@ function play() { hasStarted = true; } else { buttonPressSound.play(); - tape.play(); } isPlaying = true; |