Is there a reliable way to animate javascript while playing an audio file in a browser?

For example, I want the page to play an audio file, and at the same time, some bullets are displayed at the most appropriate moment, which was mentioned in the audio file. A similar effect will also be used for closed captioning. When I say "authentically", I mean that the time will be consistent in many common platforms (browser / OS / CPU / etc.), and also consistent in different sessions on the same platform (they activate the update , it works again the same as before, etc.).

NOTE . This is normal if the answer is “NO”, but please indicate at least a little about why this is so.

+3
source share
2 answers

Check out this animation that syncs the 3D SVG effect with the audio file.

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

Obviously, you will have to work on exploring this example and the Javascript that it uses to adapt it to your scenario. And this will probably only work in browsers that support HTML5.

+2
source

HTML5, Flash.

+1

Source: https://habr.com/ru/post/1773258/


All Articles