<!DOCTYPE html>
<html>
  <head>
    <title>Sound - 04 - Events</title>
    <script src="https://aframe.io/releases/1.0.4/aframe.min.js"></script>
    <script src="../js/livecode.js"></script>
  </head>
  <body>
    <a-scene background="color:lightblue" cursor="rayOrigin: mouse">
      <a-assets>
        <audio
          id="sonar"
          src="https://cdn.glitch.com/80978ab7-9db6-45ae-bc43-4fab16bdbb6e%2F105338__sandyrb__sonar-ping-pong-a1.mp3?1524837452409"
        ></audio>
      </a-assets>

      <a-sound position="-1 1.6 -1" on="click" volume="0.5" src="#sonar">
        <a-box color="#ff0000"> </a-box>
      </a-sound>

      <a-box
        position="1 1.6 -1"
        color="#00ff00"
        sound="src:#sonar; on: click; volume: 0.5; poolSize: 10"
      >
      </a-box>

      <a-camera>
        <a-cursor></a-cursor>
      </a-camera>
    </a-scene>
  </body>
</html>