MP3 文件的 ByteArray 的 html5 访问
我想用 html5 构建一个无缝音频播放器。当前播放歌曲的结尾应与下一首歌曲重叠,以便它们之间没有停顿。 html5 中传统的无缝播放器并不可靠:
有人说:使用 HTML5 音频无法可靠地实现无缝播放。歌曲之间总会有固有的停顿。我模拟无缝播放的唯一方法是使用两个 HTML5 音频对象,但我永远无法在所有设备上完善这两个对象之间的计时。因此,有时歌曲播放时没有间隙,有时会有间隙,有时两首连续歌曲的音频会重叠。 来源:http://forums.precentral.net/webos-homebrew-apps/261502-music-player-remix-2-0-homebrew-edition-62.html
我相信我可以工作- 如果 html5 可以访问 MP3 文件的 ByteArray 并播放“数据生成的声音”,则可以解决此问题。你知道html5是否能够做到这一点吗?
非常感谢您的任何反馈。
I would like to build a gapless audio player in html5. The end of the currently playing song should overlap the following one so that there is no pause between them. Conventional gapless players in html5 are not reliable:
Some say : Gapless playback cannot be reliably implemented using HTML5 Audio. There is always going to be an inherent pause between songs. The only way I could simulate gapless playback is by using two HTML5 audio objects, but I would never be able to perfect the timing between the two objects on all devices. So sometimes the songs would play with no gap, sometimes there would be a gap, and sometimes the audio from two consecutive songs would overlap.
source: http://forums.precentral.net/webos-homebrew-apps/261502-music-player-remix-2-0-homebrew-edition-62.html
I believe I can work-around this problem if html5 can access a MP3 file's ByteArray and play "data generated sound". Do you know if html5 is capable to do that?
Thanks a lot for any feedback.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
不幸的是,目前 HTML 规范中没有提供任何访问原始音频数据的方法。某些浏览器(例如 Firefox、Chrome)提供可以实现此目的的音频 API。但显然它不兼容跨浏览器。这会让您为各种浏览器编写实现,并且不支持 IE。
Unfortunately, at this point HTML doesn't provide any means for accessing raw audio data in the specification. Some browsers (e.g. Firefox, Chrome) provide audio APIs that can accomplish this. But obviously it's not cross browser compliant. This would leave you writing implementations for various browsers and no support for IE.