Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

When looping, playback position value is sometimes beyond the audio file's duration #1696

Open
gregsadetsky opened this issue Nov 25, 2023 · 0 comments
Labels

Comments

@gregsadetsky
Copy link

The Problem

I'm using Howler with a short 1 second file. I'm playing that file in a loop.

When I access the playback position using .seek(), Howl will often report that the position is beyond the file's duration.

In the example below, the file's .duration() is 0.9999773242630385 while the value returned by .seek() will sometimes be 1.004263038548753

Screen Shot 2023-11-24 at 8 10 43 PM

Reproducible Example

https://gregsadetsky.github.io/howler-bug-report-looping-seek-value/

Reproduction Steps

  • go to the reproducible example
  • press "Play sound in a loop"
  • you should see "Beyond duration:" messages appear on the page

The source code for this example is here.

Possible Solution

I don't know.

I'm logging the delta in number of samples (i.e. how much the seek value is "beyond" the duration value) and that number seems to regularly be ~205 samples on my machine. I'm not sure if this is indicative of something i.e. is this the size of the OS/browser audio buffer?

Context

I had an issue where I was storing the .seek() position and later setting it on the same audio file. Setting a seek that's beyond the duration of an audio file did not work (the file would not play) -- I have to resort (for now) to do seek % duration to set a value that works.

Howler.js Version

v2.2.4

Affected Browser(s)/Versiuon(s)

Google Chrome 119.0.6045.159 on macOS 12.7

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant