Skip to content

Commit

Permalink
Clean up the ES6 example
Browse files Browse the repository at this point in the history
  • Loading branch information
goldfire committed Jan 19, 2018
1 parent c4d3787 commit 97391fa
Showing 1 changed file with 11 additions and 8 deletions.
19 changes: 11 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -147,18 +147,21 @@ var id2 = sound.play();
sound.fade(1, 0, 1000, id1);
sound.rate(1.5, id2);
```

##### ES6:
```js
//import
import { Howl } from 'howler';
```javascript
import {Howl, Howler} from 'howler';

//assuming you have the file in the relative path
const warnSound = new Howl({
src: ['assets/tink.wav']
// Setup the new Howl.
const sound = new Howl({
src: ['sound.webm', 'sound.mp3']
});

//play
warnSound.play();
// Play the sound.
sound.play();

// Change global volume.
Howler.volume(0.5);
```


Expand Down

0 comments on commit 97391fa

Please sign in to comment.