Search Issue Tracker

Active

Under Consideration for 1.8.X

Votes

1

Found in [Package]

1.8.7

Issue ID

TB-309

Regression

No

Audio does not resume playing in Timeline when timeScale is set to 0 and back to 1 after the remainder of the Audio has passed in real-time

Package: Timeline

-

How to reproduce:
1. Open the “TimelineAudioBugReport.zip“ project
2. Open the “TimelineAudioPauseBug“ Scene
3. Enter Play Mode
4. Press the “Play“ Button in the Game view
5. Press the “Timescale 0“ button and after 5 seconds press the “Timescale 1“ button
6. Observe the audio

Expected result: Audio continues from where it was paused
Actual result: Audio finishes prematurely

Reproducible in: 1.6.5 (2021.3.44f1), 1.7.6 (2021.3.44f1, 2022.3.47f1), 1.8.7 (2021.3.44f1, 2022.3.47f1, 6000.0.20f1)

Reproduced on: Windows 11 Pro (23H2)
Not reproduced on: No other environment tested

Notes:
- Timeline Playhead stays in the same place, indicating that the audio as well as animation should stop
- If the Timescale is set to 1 before the audio is supposed to end, it will continue from where it stopped
- Sometimes an audio artifact can be heard when the audio is supposed to end
- If audio is played through the “AudioSource.PlayOneShot” method it will not stop when the timescale is set to 0

Comments (1)

  1. Skydome

    Oct 14, 2024 09:21

    Workaround for other people that are running into this issue. PlayableDirector.Pause() and PlayableDirector.Resume() do not have this issue.

    My Pause function now looks like this:

    public void PauseGame(bool pause)
    {
    if (pause)
    {
    Time.timeScale = 0f;

    // Pause all active PlayableDirectors
    foreach (PlayableDirector director in FindObjectsOfType<PlayableDirector>())
    {
    if (director.isActiveAndEnabled)
    {
    director.Pause();
    }
    }
    }
    else
    {
    Time.timeScale = 1f;

    // Resume all active PlayableDirectors
    foreach (PlayableDirector director in FindObjectsOfType<PlayableDirector>())
    {
    if (director.isActiveAndEnabled)
    {
    director.Resume();
    }
    }
    }
    }

Add comment

Log in to post comment

All about bugs

View bugs we have successfully reproduced, and vote for the bugs you want to see fixed most urgently.