You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
If defining sprites on a sound, calling play() without any argument results in an error. Here are examples, make sure to reload the page between two tests.
OK
// test 1 - works fine: plays the whole soundhowl_sound=newHowl({src: 'http://tests.localhost/Assets/Audio/A1-004-001.wav',format: ['wav'],});howl_sound.play();// test 2 - works fine: plays the spritehowl_sound=newHowl({src: 'http://tests.localhost/Assets/Audio/A1-004-001.wav',format: ['wav'],sprite: {hmm: [100,450,false],},});howl_sound.play('hmm');
Not OK
// test 3 - doesn't work: does not play anythinghowl_sound=newHowl({src: 'http://tests.localhost/Assets/Audio/A1-004-001.wav',format: ['wav'],sprite: {hmm: [100,450,false],},}).play();
And then, trying to howl_sound.play() again will result in the following error:
Uncaught TypeError: Cannot read properties of undefined (reading '0') at Howl.play (howler.js:826:82)
Ambiguity
I can see how there could be some ambiguity here. If defining a sprite, do we mean to use sprites EXCLUSIVELY? In my use case, I need both sprites and the ability to play parts of the audio (for one and the same piece of audio.)
If play() should always be used with an argument when sprites are defined, then the docs should say so (my apologies if ever they do and I missed it.)
Would make sense to let play() (without argument) work even when sprites are defined.
Bug report
If defining sprites on a sound, calling
play()
without any argument results in an error. Here are examples, make sure to reload the page between two tests.OK
Not OK
And then, trying to
howl_sound.play()
again will result in the following error:Ambiguity
I can see how there could be some ambiguity here. If defining a sprite, do we mean to use sprites EXCLUSIVELY? In my use case, I need both sprites and the ability to play parts of the audio (for one and the same piece of audio.)
If
play()
should always be used with an argument when sprites are defined, then the docs should say so (my apologies if ever they do and I missed it.)Would make sense to let
play()
(without argument) work even when sprites are defined.Version
Tested using https://cdnjs.cloudflare.com/ajax/libs/howler/2.2.3/howler.js
The text was updated successfully, but these errors were encountered: