简单的代码即可使用WebAudio API计算Live Mic Audio的频率 [英] Simple code to calculate frequency of Live Mic Audio using WebAudio API

查看:83
本文介绍了简单的代码即可使用WebAudio API计算Live Mic Audio的频率的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个网站,需要在该网站上显示Live Mic Audio的频率.我有一个此代码,但它很难理解(它使用傅立叶变换等.在一些研究中,我了解了 getByteFrequencyData(),该函数返回音频的频率.之前有人曾在Live Mic Audio中使用过它吗?最好在Web Audio API中使用它?

I have website in which I need to display the frequency of the Live Mic Audio. I have a this code, but its extremely difficult to understand (It uses Fourier Transform and all). On some research I got to know of getByteFrequencyData() which returns the frequency of the audio. Has anyone used it before with Live Mic Audio preferably in Web Audio API?

推荐答案

显示频率"可能有很多含义.实际上,我的PitchDetect演示不使用傅立叶变换-它使用自相关.但这只会给您一个高精度的音高.如果您的信号同时有多个音符-那么,这是一个难题.

"Displaying the frequency" can mean many things. Actually, my PitchDetect demo DOESN'T use a Fourier Transform - it uses autocorrelation. But that will only give you a single pitch, at high accuracy. If your signal has multiple simultaneous notes - well, that's a hard problem.

如果您想查看现场麦克风输入的频率分析细目,请查看 http://webaudiodemos.appspot.com/AudioRecorder/index.html (代码位于 https://github.com/cwilso/AudioRecorder ).它使用RealtimeAnalyser中的内置FFT来显示实时音频信号的频谱图.

If you want to see a frequency analysis breakdown of the live mic input, check out http://webaudiodemos.appspot.com/AudioRecorder/index.html (code at https://github.com/cwilso/AudioRecorder). That uses the built-in FFT in the RealtimeAnalyser to show a frequency spectrum graph of a live audio signal.

这篇关于简单的代码即可使用WebAudio API计算Live Mic Audio的频率的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆