readium / swift-toolkit

A toolkit for ebooks, audiobooks and comics written in Swift
https://readium.org/mobile/
BSD 3-Clause "New" or "Revised" License
223 stars 96 forks source link

Make `_AudioNavigator` periodic time observer interval configurable? #345

Closed domkm closed 8 months ago

domkm commented 8 months ago

First, thank you for providing this library!

I am using _AudioNavigator to play audiobooks and using an _AudioNavigatorDelegate to track playback position. Specifically, I am synchronizing transcribed text with spoken audio, which is reevaluated every time the MediaPlaybackInfo.time changes.

_AudioNavigator seems to use a hard-coded callback interval of 0.5 seconds to update the current MediaPlaybackInfo, which is not granular enough for my use case. I am new to Swift, so please let me know if I am misinterpreting this and the interval is, in fact, configurable. If I am interpreting this correctly, would you please consider making it configurable? I would be happy to contribute a PR with this change.

mickael-menu commented 8 months ago

Your assumption was right, I added a config option for this in https://github.com/readium/swift-toolkit/pull/348. Let me know if that helps.

domkm commented 8 months ago

Thanks!

domkm commented 8 months ago

Your assumption was right, I added a config option for this in #348. Let me know if that helps.

It's working perfectly. Thanks again!