redotvideo / revideo

Create Videos with Code
https://re.video
MIT License
2.39k stars 75 forks source link

Player fastSeekedAudio make audio sources bouncing #290

Open tangshuang opened 1 week ago

tangshuang commented 1 week ago

When I use player bundle in browser, I found the audio bouncing, for example, when the audio playing:

"I said, you are smart."

It plays like:

"I said, you ar..you are smart."

After I comment out the sentence this.setCurrentTime(time); in fastSeekedAudio method, it become normal.

        if (Math.abs(audio.currentTime - time) > 0.3) {
            // this.setCurrentTime(time);
        }

I know why and how it happens, but I could not fix it. Someone look this, may help to fix this.

justusmattern27 commented 1 week ago

@tangshuang thanks for reporting! This is a correction that makes sure audio is in sync with the actual playback. It seems like the threshold is a bit too small and causes problems in your case. I think we can increase the threshold a bit, which should fix it

tangshuang commented 6 days ago

@tangshuang thanks for reporting! This is a correction that makes sure audio is in sync with the actual playback. It seems like the threshold is a bit too small and causes problems in your case. I think we can increase the threshold a bit, which should fix it

Thanks! This may be supported as a property of Audio component?

hkonsti commented 6 days ago

I think I would prefer to have this as a constant value that can't be changed. Ideally, we'll find a good threshold that works for everyone which then makes changing it pointless. Feel free to reopen if there are more questions.

tangshuang commented 5 days ago

I think I would prefer to have this as a constant value that can't be changed. Ideally, we'll find a good threshold that works for everyone which then makes changing it pointless. Feel free to reopen if there are more questions.

However, I have try your solution, change to if (Math.abs(audio.currentTime - time) > 1) { but the problem still there.

justusmattern27 commented 5 days ago

@tangshuang can you post the code here so that we can reproduce the issue?