Comments (1)
yeah its simple code
<script type="module">import {loadGLTF, loadVideo, loadAudio} from "./loader.js"; const THREE = window.MINDAR.IMAGE.THREE; document.addEventListener('DOMContentLoaded', () => { const start = async() => { const mindarThree = new window.MINDAR.IMAGE.MindARThree({ container: document.body, imageTargetSrc: './tow', }); const {renderer, scene, camera} = mindarThree; //here is code for audio //audio load const audioClip = await loadAudio('./10.mp3'); const listener = new THREE.AudioListener(); camera.add(listener); const audio = new THREE.PositionalAudio(listener); const anchorA = mindarThree.addAnchor(9); anchorA.group.add(audio); audio.setBuffer(audioClip); audio.setRefDistance(1500); audio.setLoop(true); anchorA.onTargetFound = () => { audio.play(); } anchorA.onTargetLost = () => { audio.pause(); }from mind-ar-js.
Related Issues (20)
- Tracker distance configuration
- Play gif in WebAR HOT 15
- Preload Image Targets?
- Screen Recording in WebAR HOT 4
- Scene not rendering in Laravel HOT 2
- Using the face tracker with rear facing camera
- Multiple tracking worked with a-frame but not worked with threejs
- MindAr not loading when setting mindar-image attribute by code HOT 6
- Translating MindAR Studio Values to GLTF Properties
- How to select tracked face and crop video stream
- CDN resource reachable. wiki not use.
- Get distance from from a-camera to tracked image? HOT 5
- Multiple Image tracking HOT 2
- Play both video and its audio on both Android and IOS. HOT 3
- Canvas rendering related error HOT 1
- Zoom and rotation HOT 1
- Issue with `targetFound` event in mindAR HOT 5
- android cellphone open the worry camera HOT 2
- React example clears aframe objects on arSystem.start() HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from mind-ar-js.