npm i -S sono
import sono from 'sono';
Use the returned reference:
const sound = sono.create('boom.mp3');
sound.play();
Or use an Id:
sono.create({
id: 'boom',
url: 'boom.mp3'
});
sono.play('boom');
Set an array of effects:
import echo from 'sono/effects/echo';
import reverb from 'sono/effects/reverb';
const sound = sono.create('boom.mp3');
sound.effects = [echo(), reverb()];
sound.play();
Or use the add
function to return the reference:
import echo from 'sono/effects/echo';
import reverb from 'sono/effects/reverb';
const sound = sono.create('boom.mp3');
const echo = sound.effects.add(echo());
const reverb = sound.effects.add(reverb());
sound.play();
import sono from 'sono';
sono.log(); // sono 0.2.0 Supported:true WebAudioAPI:true TouchLocked:false Extensions:ogg,mp3,opus,wav,m4a