分析来自麦克风 Javascript 的音频输入
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/16660740/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Analyze audio input from microphone Javascript
提问by Runeony1
I am planning to create a music visualizer on a website. There are objects that should change in size, and shape based off of the current music that is playing (a non-classical, multi-line song probably, such as Don't Stop believing). I want to at least be able to know the volume of the music and if possible, any pitches that can be picked up (is FFT possible in Javascript?). Are there Sound API's out there that that will let me do this in Javascript, or at least online?
我打算在网站上创建一个音乐可视化工具。根据当前正在播放的音乐(可能是一首非经典的多行歌曲,例如 Don't Stop Believing),某些对象的大小和形状应该会发生变化。我希望至少能够知道音乐的音量,如果可能的话,任何可以拾取的音高(在 Javascript 中是否可以进行 FFT?)。是否有 Sound API 可以让我使用 Javascript 或至少在线执行此操作?
回答by cwilso
Yes, this is possible with the Web Audio API. Check out the Audio Input demo on http://webaudiodemos.appspot.com/. You don't need to perform the FFT yourself - the web audio api will do it for you.
是的,这可以通过 Web Audio API 实现。在http://webaudiodemos.appspot.com/上查看音频输入演示。您不需要自己执行 FFT - 网络音频 api 会为您完成。