Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

Audio Audio out of sync when playback speed of video is changed

Discussion in 'Audio & Video' started by MarvellousLunatic, Jun 25, 2022.

  1. MarvellousLunatic

    MarvellousLunatic

    Joined:
    May 1, 2020
    Posts:
    11
    Greetings,

    I have a few short videos (2s - 10s) with audio on loop using Unity's Video Player. Videos are Webm files (Codex: Video: VP8, Audio: Vorbis). I change the speed of the video dynamically with a UI Slider. The video processing is fine, but the audio gets out of sync at some point and if the video is slown down to 0.5f playback speed. The audio starts stuttering and starts throwing warnings like:

    AudioSampleProvider buffer overflow. 1028 sample frames discarded

    I had a look at google and found a few threads / bug reports but there were either no solutions or blamed low device specs (this is definitely not the case for my pc build). Does someone has experience with this behavior?

    Kind regards.
     
    Last edited: Jun 27, 2022
  2. The_Island

    The_Island

    Unity Technologies

    Joined:
    Jun 1, 2021
    Posts:
    502
    I have experienced this before, and I know there have been some bug fixes trying to correct this. You didn't mention your Unity version, but I recommend testing your project on the latest Unity version (2022 in this case) to see if your bug is fixed. If not, I recommend opening a bug report if you can reproduce it frequently. https://unity3d.com/unity/qa/bug-reporting
     
  3. MarvellousLunatic

    MarvellousLunatic

    Joined:
    May 1, 2020
    Posts:
    11
    Hi, thanks for the response. I'm on 2021.2.3f1 at the moment. I'll try to update Unity and see if it fixes it, otherwise I'll try to create a bug-report with a sample build. Thanks for the suggestion.

    Edit_1: I updated Unity to 2022.1.0b16.3019 and the issue is still appearing. So I'll try to create a smaller build for the bug report.

    Edit_2: The playback speed is different depending on the framerate of the clip. The playback-speed is practically not changing when setting the playbackspeed to 2 when playing a 60fps webm file. The audio how ever gets out of sync.
     
    Last edited: Jun 27, 2022