I have been working on setting up an audio sprite using Howler.js
. The basic functionality of the sprite is working well, but I am facing an issue when trying to resume playback after pausing a sprite. When I call play()
, it does not work as expected.
sound = new Howl({
urls: ['http://<your audio asset>'],
sprite: {
frame1: [260, 4400],
frame2: [4700, 2400],
frame3: [7100, 2200],
frame4: [9300, 2100],
frame5: [11400,5100],
frame6: [16500, 3000]
}
});
----------------HTML-------------------
<button onclick="sound.play('frame6')">
Play Frame 6
</button>
<button onclick="sound.pause()">
Pause
<button onclick="sound.play()">
Play
</button>
Here are my steps:
- Click on "Play Frame 6" button
- Click on "Pause" button
- Click on "Play" button (expected behavior: should resume playing frame 6, actual result: no sound at all)