【发布时间】:2014-12-16 14:22:19
【问题描述】:
我用这个教程:http://typedarray.org/from-microphone-to-wav-with-getusermedia-and-web-audio/
还有这个现场演示页面:http://typedarray.org/wp-content/projects/WebAudioRecorder/
创建我的高频分析仪。
我的问题是 Web Audio API,我的东西,默认情况下会切断高频。
当我录制 WAV 并播放 10000hz 信号时,wav 包含我的频率。
如果我播放 17000hz 信号,wav 不包含我的频率。
如何禁用低通滤波器?
代码:
function success(e){
// creates the audio context
audioContext = window.AudioContext || window.webkitAudioContext;
context = new audioContext();
// creates a gain node
volume = context.createGain();
// creates an audio node from the microphone incoming stream
audioInput = context.createMediaStreamSource(e);
// connect the stream to the gain node
audioInput.connect(volume);
/* From the spec: This value controls how frequently the audioprocess event is
dispatched and how many sample-frames need to be processed each call.
Lower values for buffer size will result in a lower (better) latency.
Higher values will be necessary to avoid audio breakup and 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);
// we clone the samples
leftchannel.push (new Float32Array (left));
rightchannel.push (new Float32Array (right));
recordingLength += bufferSize;
}
// we connect the recorder
volume.connect (recorder);
recorder.connect (context.destination);
}
【问题讨论】:
-
请向我们展示相关的男女同校。
-
你现在可以看到代码了
标签: javascript audio web