MP3 文件的 ByteArray 的 html5 访问

发布于 2024-11-30 21:41:39 字数 572 浏览 1 评论 0原文

我想用 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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

仅此而已 2024-12-07 21:41:39

不幸的是,目前 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.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文