jQuery onclick 播放声音并加快/减慢速度
I want 4 buttons.
1.When you click PLAY a sound plays continously.
For example this sound; clicking sound
2.STOP stops the loop.
3.FASTER (interval) increases the bpm
4.SLOWER (interval) decreases the bpm
How can this be accomplished?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
这不会完全回答您的问题,但您检查过 jQuery 插件吗
jPlayer?
更新:
进一步查看您的问题,并聆听您提供的声音样本,看起来您正在尝试创建某种节拍器?如果你使用 JS,就很难使其非常准确。即使使用 setInterval 也不能保证声音/点击之间的间隔如您可能想要的那样精确。
考虑服务器端实际上会动态构建文件并将其流式传输到浏览器。
This won't COMPLETELY answer your question/issue, but have you checked out the jQuery plugin
jPlayer?
UPDATE:
Looking at your question further, and listening to the sound sample you provided, it looks like you are trying to create a metronome of sorts? If you're using JS, it's going to be hard to make it very accurate. Even using setInterval won't guarantee as exact an interval between sounds/clicks as you'd probably want.
Consider something server-side that will actually build a file on-the-fly and stream it to the browser.