我怎样才能检测出一个声音是否在听觉范围内?
例如,
在以下情况下显示沉默图标:
相反,stream.paused是false。
发布于 2016-10-11 20:36:41
您可以使用此基音检测音频库。
示例:
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.发布于 2016-03-25 01:05:32
我不知道你能不能用javascript找到hz。您可能需要使用web音频API。但是,使用javascript,您肯定可以检查和设置一个数字比例尺的卷。查看这里的详细信息和示例代码:volume.asp
示例值: 1.0是最高音量(100% )。这是默认的) 0.5是一半音量(50%) 0.0是静音(与静音相同)
https://stackoverflow.com/questions/36211844
复制相似问题