Howler.js: First load of audio causes it to play twice if invoking .play().

Created on 13 Sep 2014  路  2Comments  路  Source: goldfire/howler.js

37.0.2062.120 m (64-bit)

1) Clear your Chrome cache.
2) Play an audio file. (mp3 in my case, and autoplay set to true)
3) Run play on it... it will play twice.

This only happens on first load.

Workaround: run .pause (), then .play ().

Most helpful comment

I am experiencing the same issue. This plays the audio twice, slightly overlapped:
const audio = new Howl({
src: src,
autoplay: false,
loop: false,
pool: 1,
volume: 0.3
});

    audio.once('load', () => {
        console.log('loaded');
        audio.play();
    });

Very basic, so no idea why... And the console only logs 'loaded' once.

All 2 comments

This is not a bug since a Howl is meant to play more than one sound at a time. The API for this is made more clear in the upcoming 2.0 release.

I am experiencing the same issue. This plays the audio twice, slightly overlapped:
const audio = new Howl({
src: src,
autoplay: false,
loop: false,
pool: 1,
volume: 0.3
});

    audio.once('load', () => {
        console.log('loaded');
        audio.play();
    });

Very basic, so no idea why... And the console only logs 'loaded' once.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

sibelius picture sibelius  路  3Comments

indexofrefraction picture indexofrefraction  路  4Comments

proyb6 picture proyb6  路  4Comments

Glutch picture Glutch  路  3Comments

st-h picture st-h  路  5Comments