Search Unity

  1. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

Bug AudioTrack not audible when setting speed of root playable to zero and back to one again

Discussion in 'Timeline' started by Midonk, Oct 5, 2023.

  1. Midonk

    Midonk

    Joined:
    Oct 8, 2018
    Posts:
    35
    Unity v2022.2.1f1
    Timeline v1.7.5

    Hi everyone, Here is my problem.
    I am "pausing" my timelines by setting the root playable speed to zero (so the process frame continues to get called) to allow the player to read subtitles on the screen. This "pause" is an optionnal mode so player can either play the timelines with or without pauses.
    The thing is when the playhead stops relatively close before an audio clip for a certain time (personnaly I am counting for 5 seconds), when I "resume" the timeline (by setting the root playable speed to one) the clip isn't audible.

    The issue can be reproduced with a director in Game Time or in DSP Clock
    It seems to appear when the playhead stops around 6 frames (60fps) before the clip. Above that threshold I can hear the clip.
    I ensured that the playhead never stops at the beginning of the audio clip
    The audio clips I tested are about 2.5 seconds long but I don't think this matters a lot

    If anyone has a tip on what is happening and how I could fix this it would help me a lot thanks !
     
  2. Midonk

    Midonk

    Joined:
    Oct 8, 2018
    Posts:
    35
    Hello @karl_jones, sorry to wildly ping you for this one but I investigated the issue and there may be something in the internal process of Unity timeline I don't have access to that produces this behaviour. Let me summerize what I found out.

    First of all, I successfully reproduced the bug on a minimal project (Unity 2022.2.1, Timeline 1.7.6).
    For the setup,
    I have 2 tracks:
    - One AudioTrack with several clips on it
    - One Custom track that simply set the root playable speed to zero once a clip stops reading and set it back to one when I press any key.

    - The PlayableDirector plays on awake
    - The custom track's clips are at the same position and have the same duration as those of the AudioTrack
    - The so formed clip "groups" are separated from each other by several frames (at least one)

    How to reproduce:
    - Enter play mode
    - Let the timeline play the first sound, it should pause at the end of this clip
    - Wait some time (for a sound of 1.5 seconds, wait around 3 seconds)
    - Resume the timeline
    - There shoudn't have any sound playing on the next read clip
    Note:
    - I noticed that the waiting time required before resuming the timeline and having the bug is influenced by the next audio clip duration
    - The bug don't appears when you resume immediately the timeline once paused

    I hope this could help to determine the source of the problem
     
  3. karl_jones

    karl_jones

    Unity Technologies

    Joined:
    May 5, 2015
    Posts:
    8,133
    Hi,
    Could you please file a bug report? Timeline is not my area so there's not much I can do but a bug report will help get the information to the right team. https://unity.com/releases/editor/qa/bug-reporting
    Thanks