Skip to content

Latest commit

 

History

History
70 lines (51 loc) · 1.15 KB

getting-started.md

File metadata and controls

70 lines (51 loc) · 1.15 KB

Getting Started

Install

npm i -S sono

Import

import sono from 'sono';

Create a sound object

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');

Add some effects

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();

Log info on browser support

import sono from 'sono';
sono.log(); // sono 0.2.0 Supported:true WebAudioAPI:true TouchLocked:false Extensions:ogg,mp3,opus,wav,m4a

Further documentation

Sounds

Effects

Controls

Utils