Animation with Audio

Animation with Audio

Topic Progress:

Animated Audio

In this example the user has the impression that the sound is moving around him:

<a-assets>
  <audio
    id="chaplin"
    src="audio/chaplin_4.mp3"
    volume="1.0"
  ></audio>
</a-assets>
<a-entity position="0 0 0">
  <a-box
    color="#FFFF00"
    position="0 0 -5"
    sound="src:#chaplin; loop:true; autoplay:true;"
  ></a-box>
  <a-animation
    attribute="rotation"
    from="0 0 0"
    to="0 360 0"
    dur="5000"
    easing="linear"
    repeat="inifite"
  ></a-animation>
</a-entity>

The 3D-Effect only works, when loop and autoplay are in the animated entity and not in the Assets (tested with A-Frame 0.8).

Example

Try it out with the example.

 

Comments are closed.