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

Using audioFactory explanation is missing vital information #3145

Open
barakhub opened this issue Jan 2, 2025 · 0 comments
Open

Using audioFactory explanation is missing vital information #3145

barakhub opened this issue Jan 2, 2025 · 0 comments

Comments

@barakhub
Copy link

barakhub commented Jan 2, 2025

Environment

  • Browser: Chrome 131.0.6778.205 (Official Build) (arm64) on macOS Version 14.7.2 (Build 23H311)
  • Not using After Effects - manually created lottie JSON file (very simple).

Reproduction

I'm trying to play a simple Lottie animation with audio and following the information provided in https://github.com/airbnb/lottie-web/wiki/Audio.

Expected behavior

I expect to have a complete documentation of the ability to use my own audioFactory, but the explanation is very imcomplete.

Note: I'm not using Howler as it doesn't look like it supports playing multiple audio layers at the same time (e.g. a background track with some sound effects during it).

Actual behavior

The above page is missing (at least) the following:

  • What are the parameters / return values of functions like play, seek and playing.
  • For example, I see that seek is sometimes used to get the current playback position and sometimes used to set it (passing a time value).
  • It seems the audioFactory should return an object that also has a pause function, but this is not mentioned in the documentation.

Specifically for seek, it seems the play position is animation-based and not per-audio position. For example, I have an audio layer that starts at 3 seconds (into the animation) with a short audio that takes 1.3 seconds, the audio gets a play call at the right time, followed immediately by a seek with a value of 3.007. Obviously, this is not the seek time within the audio.

So I think it makes sense to add a clarification about animation vs. audio time. E.g.:

  • Can the audio player expect a play followed immediately by a seek with the current animation time, so it can use it as an offset?
  • What happens if the same audio is played on two different layers at different times, will each layer cause its own call to the audio factory? Otherwise, do we need to handle concurrent playback of the same audio?

After Effects demo file

Not relevant for this, as I didn't use After Effects, but the Lottie file is trivial - attaching it:
lottie-animation.json

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

No branches or pull requests

1 participant