motion-canvas / motion-canvas

Visualize Your Ideas With Code

Home Page:https://motioncanvas.io

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

The audio sound is not aligned with the audio track.

CleverFlare opened this issue · comments

Describe the bug
I have a project with an mp3 file, when I play the video from the beginning, everything is fine, but when I play it from anywhere in the middle, the audio is not aligned with the actual sound track at all.

To Reproduce

  1. Add an audio file to your project
import audio from "../audio/voice.mp3";

export default makeProject({
    // ...
    audio,
})
  1. Make some animation.
  2. Run npm start in the terminal.
  3. Play the video from the beginning and see if the audio is aligned with the audio track (most probably, everything will be fine).
  4. Jump to any point in the video and play it, you'll notice that the audio is out of sync with the audio track.

Expected behavior
I expect the audio sound to be in synchronization with the audio track.

Console errors
No errors.

Package versions:
Click on the version in the bottom right corner to copy the versions

  • core: 3.14.1
  • two: 3.14.2
  • ui: 3.14.2
  • vitePlugin: 3.14.1

Additional context
Some silence gaps exist between the sounds in the audio I'm importing.

After expressing my genuine gratefulness and appreciation for such an incredible project, I'm currently working on an important video using Motion Canvas for my JavaScript course, and this bug is troubling me badly, so if it could be solved in the next release, it would be greatly appreciated. 🙏🏻

@CleverFlare could you convert your audio to wav and see if the problem still occurs?
mp3 is a heavily compressed format and browsers seem to have issues with precise seeking. I've been noticing it too in my projects, I even have a note in the readme of my videos: https://github.com/motion-canvas/examples?tab=readme-ov-file#audio-quality

@aarthificial Yeah, converting my file into wav solved the issue for me, thank you very much. 🤍
Alright then, I'll use wav formats from now on, thanks a lot for your help. ✨

This fix also worked for me!