<!DOCTYPE html>
<html>
<head>
<title>Sound - 05 - Events Proximity</title>
<script src="https://aframe.io/releases/1.0.4/aframe.min.js"></script>
<script src="https://unpkg.com/aframe-proxemic-component@0.0.17/dist/aframe-proxemic-component.min.js"></script>
<script src="../js/livecode.js"></script>
</head>
<body>
<a-scene background="color:lightblue">
<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
proximity-sensor="distance: 1"
position="-1 1.6 -2"
on="proximityenter"
volume="0.5"
src="#sonar"
>
<a-box color="#ff0000"> </a-box>
</a-sound>
<a-box
proximity-sensor="distance: 1"
position="1 1.6 -2"
color="#00ff00"
sound="src:#sonar; on: proximityenter; volume: 0.5"
>
</a-box>
<a-camera>
<a-cursor></a-cursor>
</a-camera>
</a-scene>
</body>
</html>