Soundcloud (javaScript) 自定义播放器创建频谱分析仪
我正在实现 Soundcloud 自定义播放器( https://github.com/soundcloud/soundcloud-custom-我的网站上的播放器)。
我想创建一个根据声音移动的频谱分析仪。
我真的不知道从哪里开始,或者是否有可能。
请查看我的网站以了解我的意思:http://dev.upcoming-djs.com
在右侧您可以看到播放器,当您单击播放时,它开始播放并且均衡器开始移动。
目前这是一个假效果,但我希望它随着声音移动。
当然,非常感谢所有建议和/或帮助。
I'm implementing the Soundcloud custom player ( https://github.com/soundcloud/soundcloud-custom-player ) on my site.
I would like to create a spectrum analyzer which moves based on the sound.
I really don't have any idea as to where to start or if it even is possible at all.
Please check out my site to see what I mean: http://dev.upcoming-djs.com
At the right side you see the player and when you click on play it starts playing and the equalizer starts moving.
This is currently a fake effect, but I want it to move with the sound.
All suggestions and/or help is of course much appreciated.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(4)
添加我的评论作为答案:
您可能想研究一下 HTML5 音频数据 API。除此之外,如果您想要一个合法的频谱分析仪(顺便说一下,这就是您所要求的,而不是均衡器),您将需要 Flash。
编辑:
对于任何感兴趣的人,我在这里有一个快速而肮脏的演示:http://kevincennis.com/audio/(仅限 Chrome)
源代码未缩小,但没有特别好的评论。随意偷你想要的任何东西。
Added my comment as an answer:
You might want to look into the HTML5 Audio Data API. Other than that, you're going to need Flash if you want a legit spectrum analyzer (which, by the way, is what you're asking for. not an equalizer).
Edit:
For anyone interested, I have a quick and dirty demo here: http://kevincennis.com/audio/ (Chrome only)
Source is un-minified, but not particularly well commented. Feel free to steal whatever you want.
简单的答案是这不能仅使用 javascript 来完成。
您可以选择使用 Flash 等插件,该插件具有广泛的音频 API,并且作为插件安装在大部分 Web 用户浏览器上,或者研究实验性 HTML5 音频 API。
希望这有帮助
The simple answer is this can not be done just using javascript.
Your options are to use to a plugin like flash which has a extensive audio API and is installed on a large percentage of web users browsers as a plugin or to look into the experimental HTML5 audio API.
hope this helps
声音管理器 2
看看
http://www.schillmania。 com/projects/soundmanager2/demo/360-player/canvas-visualization.html#hifi=1
Sound manager 2
Take a look at
http://www.schillmania.com/projects/soundmanager2/demo/360-player/canvas-visualization.html#hifi=1
我写了一篇关于这个的文章,如果你有兴趣的话。 http://www.flobii-cc.com/2011 /04/simple-fft-web-visualization.html
我使用 SoundManager2- API(需要 flash)来获取频谱数据,并使用 HTML5 Canvas 来可视化它们。
(HTML5 音频 API 仅限于少数浏览器)
I wrote a article about this, if you are interested. http://www.flobii-cc.com/2011/04/simple-fft-web-visualization.html
I used the SoundManager2- API ( need flash) to get the spectrum data and HTML5 Canvas to visualize them.
(The HTML5 Audio API is limited to only a few browsers)