sparkar-sound

0.4.0 • Public • Published

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

  1. Download Sound

  2. Drag/Drop or Import Sound.js to Spark AR

  3. Import Sound module

    import { Sound } from './Sound';
    // Your script...
  4. You can also Click Here to Download a Sample Project.

npm

  1. Add package with yarn or npm

    yarn add sparkar-sound

    or

    npm i sparkar-sound
  2. 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();
}

Readme

Keywords

Package Sidebar

Install

npm i sparkar-sound

Weekly Downloads

2

Version

0.4.0

License

MIT

Unpacked Size

5.58 kB

Total Files

3

Last publish

Collaborators

  • pofulu