Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <script>
- var audioCtx=new AudioContext();
- var oscillator = audioCtx.createOscillator();
- var gainNode = audioCtx.createGain();
- oscillator.connect(gainNode);
- gainNode.connect(audioCtx.destination);
- var Outt=prompt('Enter Value (0.1 to 1.0:)');
- var WIDTH = window.innerWidth;
- var HEIGHT = window.innerHeight;
- var FreqMax = 200;
- var VolMax = 1.0;
- var Freq = 50;
- var Vol = Outt;
- gainNode.gain.value=parseFloat(Outt);
- oscillator.type = 'sawtooth';
- oscillator.frequency.value = Freq;oscillator.start();
- </script>
- <button onclick="gainNode.gain.value=0.0;">0.0</button>
- <button onclick="gainNode.gain.value=0.1;">0.1</button>
- <button onclick="gainNode.gain.value=0.2;">0.2</button>
- <button onclick="gainNode.gain.value=0.3;">0.3</button>
- <button onclick="gainNode.gain.value=0.4;">0.4</button>
- <button onclick="gainNode.gain.value=0.5;">0.5</button>
- <button onclick="gainNode.gain.value=0.6;">0.6</button>
- <button onclick="gainNode.gain.value=0.7;">0.7</button>
- <button onclick="gainNode.gain.value=0.8;">0.8</button>
- <button onclick="gainNode.gain.value=0.9;">0.9</button>
- <button onclick="gainNode.gain.value=1.0;">1.0</button>
Advertisement
Add Comment
Please, Sign In to add comment