@zonesoundcreative/web-player
v0.0.5
Published
This is a player using Tone.js.
Downloads
3
Readme
Player
This is a player using Tone.js.
(Still in Development)
How to use
Pre-Install
The package use jquery
and tone.js(v13)
.
npm install --save jquery
npm install --save tone
Import
import Player, {PlayerUI} from '@zonesouncreative/web-player'
Usage
First, new an instance of Player with soundfile url and loaded callback function(optional).
let loadCallback = ()=> {
console.log('load!');
}
let player = new Player(url, loadCallback);
PLAY play the soundfile
//play the sound
player.play();
//or play the sound from specific offset(e.g. from 10sec)
player.play(10);
PAUSE
player.pause();