我想知道有没有一种方法可以检测 html 5 网络音频中麦克风的音频。我希望制作一个在线吉他调音器,并且我需要从声音输入获得以赫兹为单位的音频。我看到了一些均衡器和滤波器效果,但没有看到任何有关频率识别的内容。
编辑:
我找到了这个:http://www.smartjava.org/content/exploring-html5-web-audio-visualizing-sound http://www.smartjava.org/content/exploring-html5-web-audio-visualizing-sound第二点(分析器节点)非常有趣。我看过他的源代码,但我不知道如何将分析仪连接到麦克风输入。
当 mp3 文件开始播放时,他调用 playSound() 函数,并在那里绘制画布。但我没有类似 playSound() 的功能......
我编写了一个网络音频库,除其他外,它可以检测麦克风输入的频率。检查一下:https://github.com/rserota/wad#pitch-detection https://github.com/rserota/wad#pitch-detection
var voice = new Wad({source : 'mic' });
var tuner = new Wad.Poly();
tuner.add(voice);
voice.play();
tuner.updatePitch() // The tuner is now calculating the pitch and note name of its input 60 times per second. These values are stored in tuner.pitch and tuner.noteName.
var logPitch = function(){
console.log(tuner.pitch, tuner.noteName)
requestAnimationFrame(logPitch)
};
logPitch();
// If you sing into your microphone, your pitch will be logged to the console in real time.
tuner.stopUpdatingPitch(); // Stop calculating the pitch if you don't need to know it anymore.
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)