0.4.0 • Published 4 years ago
sparkar-sound v0.4.0
Sound
Sound is a simple tool to control audio with script in Spark AR.
This is the reconstructed version of sparkar-audio-objcet.
Install
Import
Drag/Drop or Import
Sound.js
to Spark ARImport
Sound
moduleimport { Sound } from './Sound'; // Your script...
You can also Click Here to Download a Sample Project.
npm
Add package with
yarn
ornpm
yarn add sparkar-sound
or
npm i sparkar-sound
Load in the required module
import { Sound } from 'sparkar-sound' // Your script...
Usage
Please make sure the speaker and audio playback controller have the same name.
async function main(){
// Declared a sound
const sfx = await Sound('sfx');
// play the sound
sfx.play();
}