0.4.0 • Published 5 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.jsto Spark ARImport
Soundmoduleimport { Sound } from './Sound'; // Your script...You can also Click Here to Download a Sample Project.
npm
Add package with
yarnornpmyarn add sparkar-soundor
npm i sparkar-soundLoad 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();
}