Changing the pitch of the sound of an HTML5 audio node -


i change pitch of sound file using html 5 audio node. had suggestion use setvelocity property , have found function of panner node have following code in have tried changing call parameters, no discernible result.

does have ideas, please?

i have folowing code:

var gaudiocontext = new audiocontext() var  gaudiobuffer; var playaudiofile = function (gaudiobuffer) {     var panner = gaudiocontext.createpanner();     gaudiocontext.listener.dopplerfactor = 1000     source.connect(panner);      panner.setvelocity(0,2000,0);     panner.connect(gainnode);     gainnode.connect(gaudiocontext.destination);     gainnode.gain.value = 0.5      source.start(0); // play sound   };  var loadaudiofile = (function (url) {     var request = new xmlhttprequest();     request.open('get', 'sounds/english.wav', true);     request.responsetype = 'arraybuffer';     request.onload = function () {             gaudiocontext.decodeaudiodata(request.response,                  function(incomingbuffer) {                      playaudiofile(incomingbuffer);                  }             );     };     request.send(); }()); 

i'm trying achieve similar , failed @ using pannernode.setvelocity(). 1 working technique found using following package (example included in readme): https://www.npmjs.com/package/soundbank-pitch-shift

it possible biquad filter, available natively. see example here: http://codepen.io/qur2/pen/emvqww didn't find simple sound make obvious (cors restriction ajax loading). can read more @ http://chimera.labs.oreilly.com/books/1234000001552/ch04.html , https://developer.mozilla.org/en-us/docs/web/api/biquadfilternode.

hope helps!


Comments

Popular posts from this blog

c++ - QTextObjectInterface with Qml TextEdit (QQuickTextEdit) -

javascript - angular ng-required radio button not toggling required off in firefox 33, OK in chrome -

xcode - Swift Playground - Files are not readable -