How to raise frequency of sounds - javascript -
i trying raise frequency of every node in sound. have tried many ways. here small code work, it's not working. please help. in advance.
<script src="./wad.js"></script> <script src="./tuna.js"></script> <script> var countaudio = 1; var voice = new wad({source : 'mic'}); var tuner = new wad.poly(); tuner.add(voice); voice.play({volume : 1}); logpitch(); function logpitch() { tuner.updatepitch() localstorage.setitem(countaudio, tuner.pitch) countaudio = countaudio + 1; if (countaudio < 1000) { settimeout(logpitch, 5) } else { tuner.stopupdatingpitch() voice.stop() highvoice(countaudio) } }; = 1; var audioctx = new (window.audiocontext || window.webkitaudiocontext)(); function playnote(frequency, duration) { var oscillator = audioctx.createoscillator(); oscillator.type = 'square'; oscillator.frequency.value = frequency; // value in hertz oscillator.connect(audioctx.destination); oscillator.start(); settimeout( function(){ oscillator.stop(); }, duration); } function highvoice(amount) { if (!(i = amount)) { item = localstorage.getitem(i); playnote(item,10); = + 1; settimeout(highvoice(amount), 10); } else { = 1; } } </script>
Comments
Post a Comment