有没有可靠的方法来对浏览器中播放的音频文件进行 JavaScript 动画计时?

发布于 2024-10-01 07:47:43 字数 221 浏览 1 评论 0原文

例如,我希望页面播放音频文件,同时让一些项目符号在音频文件中讨论所述项目符号的正确时刻滑入视图。类似的效果也可用于隐藏式字幕。当我说可靠时,我特指的是,时间在许多常见平台(浏览器/操作系统/CPU/等)上是一致的,并且在同一平台上的不同会话中也是一致的(它们点击刷新,它会像以前一样再次工作) , ETC)。

注意:如果答案是“否”也没关系,但请至少包含一些关于原因的俏皮话。

For example, I want the page to play an audio file while at the same time have some bullets slide into view at just the right moment that said bullet is talked about in the audio file. A similar effect would also be used for closed captioning. When I say reliable I mean specifically that the timing will be consistent across many common platforms (browser/OS/CPU/etc) as well as consistent in different sessions on the same platform (they hit refresh, it works again just as it did before, etc).

NOTE: It's OK if the answer is 'NO', but please include at least a little quip about why that is.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

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

发布评论

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

评论(2

紫罗兰の梦幻 2024-10-08 07:47:43

查看此动画,它将 3D SVG 效果同步到音频文件。

该技术在 http://mrdoob.com/blog/page/3。查找标题为“svg 标签+音频标签= 3D 波形”的内容。关键是创建一个与音频文件对应的音量值表。

显然,您需要做一些工作来研究这个示例及其使用的 Javascript,以使其适应您的场景。它可能只能在支持 HTML5 的浏览器中运行。

Check out this animation, which synchronizes a 3D SVG effect to an audio file.

The technique is explained in a blog post at http://mrdoob.com/blog/page/3. Look for the one entitled "svg tag+audio tag = 3D waveform". The key is to create a table of volume values corresponding to the audio file.

You'll obviously have some work to do in studying this example and the Javascript it uses to adapt it to your scenario. And it will probably only work in browsers that support HTML5.

为你鎻心 2024-10-08 07:47:43

考虑到目前的情况和 HTML5 支持,我会使用 Flash 来解决这个问题。

Given the current situation and HTML5 support, I would solve this using Flash.

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