Skip to content

Commit 7b0770d

Browse files
committed
fix audiocontext resume
1 parent d829848 commit 7b0770d

File tree

2 files changed

+8
-3
lines changed

2 files changed

+8
-3
lines changed

index.html

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<!DOCTYPE html>
22
<html>
33
<head>
4-
<title></title>
4+
<title>abduhslab</title>
55
<meta name="viewport" content="width=device-width, initial-scale=1.0">
66
<link href="css/style.css" rel="stylesheet">
77
<link href='http://fonts.googleapis.com/css?family=Open+Sans' rel='stylesheet' type='text/css'>
@@ -28,7 +28,7 @@
2828
<canvas style="display:none;" id="canvas" width="640" height="480"></canvas>
2929

3030
<br>
31-
<button id="mute-button" onclick="doMute()"> Unmute </button>
31+
<button id="mute-button" onclick="doMute()"> Mute/Unmute </button>
3232

3333
<div id="texte">
3434
<h3 id="vol">
@@ -43,7 +43,7 @@ <h3 id="chord">
4343
<div>
4444

4545
<h2>or vice versa<h2>
46-
<p>Use latest desktop google chrome, turn your webcam and speaker on </br> and turn down your speaker's volume into adequate level.</p>
46+
<p>Need camera permission to run this. Turn your webcam and speaker on </br> and turn down your speaker's volume into adequate level.</p>
4747
</div>
4848

4949

js/theremin.js

+5
Original file line numberDiff line numberDiff line change
@@ -211,6 +211,11 @@ function loadSounds() {
211211
//S(c); // oscillator type
212212
//alert("Turn your volume down to the minimum value first because this theremin will produce sound at maximum level at the first time it is started");
213213
oscillator.start(1);
214+
if(soundContext.state === 'running') {
215+
muteButton.textContent = 'Mute';
216+
} else if(soundContext.state === 'suspended') {
217+
muteButton.textContent = 'Unmute';
218+
}
214219
}
215220

216221
function playSound(e) {

0 commit comments

Comments
 (0)