Skip to content

Commit 1bd3401

Browse files
goldfirebhaskarp-vg
authored andcommitted
Clean up the ES6 example
1 parent 830869d commit 1bd3401

File tree

1 file changed

+11
-8
lines changed

1 file changed

+11
-8
lines changed

README.md

+11-8
Original file line numberDiff line numberDiff line change
@@ -147,18 +147,21 @@ var id2 = sound.play();
147147
sound.fade(1, 0, 1000, id1);
148148
sound.rate(1.5, id2);
149149
```
150+
150151
##### ES6:
151-
```js
152-
//import
153-
import { Howl } from 'howler';
152+
```javascript
153+
import {Howl, Howler} from 'howler';
154154

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

160-
//play
161-
warnSound.play();
160+
// Play the sound.
161+
sound.play();
162+
163+
// Change global volume.
164+
Howler.volume(0.5);
162165
```
163166

164167

0 commit comments

Comments
 (0)