javascript - Web Audio APIs - Capture audio - Disable low pass filter -
i use tutorial: http://typedarray.org/from-microphone-to-wav-with-getusermedia-and-web-audio/
and live demo page: http://typedarray.org/wp-content/projects/webaudiorecorder/
to create high frequency analyzer.
my problem web audio api, thing, default cut off high frequencies.
when record wav , play 10000hz signal, wav contain freq.
if play 17000hz signal, wav don't contain freq.
how disable low pass filter?
code:
function success(e){ // creates audio context audiocontext = window.audiocontext || window.webkitaudiocontext; context = new audiocontext(); // creates gain node volume = context.creategain(); // creates audio node microphone incoming stream audioinput = context.createmediastreamsource(e); // connect stream gain node audioinput.connect(volume); /* spec: value controls how audioprocess event dispatched , how many sample-frames need processed each call. lower values buffer size result in lower (better) latency. higher values necessary avoid audio breakup , glitches */ var buffersize = 2048; recorder = context.createjavascriptnode(buffersize, 2, 2); recorder.onaudioprocess = function(e){ console.log ('recording'); var left = e.inputbuffer.getchanneldata (0); var right = e.inputbuffer.getchanneldata (1); // clone samples leftchannel.push (new float32array (left)); rightchannel.push (new float32array (right)); recordinglength += buffersize; } // connect recorder volume.connect (recorder); recorder.connect (context.destination); }
this in getusermedia
, not web audio api. default, mediastream
getusermedia
gives contains data has been (depending on browser): - echo cancelled - had noise suppressed - had automatic gain compensation applied
you can disable using constraints (for example, firefox):
navigator.mediadevices.getusermedia({audio: { echocancellation: false, moznoisesuppression: false, mozautogaincontrol: false });
we standardizing properties, we're not done yet.
Comments
Post a Comment