Search Issue Tracker
By Design
Votes
0
Found in
2018.4
2019.2
2019.3
2019.3.0b9
2020.1
Issue ID
1196325
Regression
No
Custom Audio Asset doesn't emit sound when played in Timeline
How to reproduce:
1. Open the attached project's Scene labeled "SampleScene"
2. Select the "Timeline" GameObject from the Hierarchy
3. In the Timeline Window's tab press "Space" Key to Play the Timeline
Expected result: there's sound emitted from the CustomAudioPlayableAsset Audio Track
Actual result: there's no sound emitted from the CustomAudioPlayableAsset Audio Track
Reproducible with: 2018.4.13f1, 2019.2.14f1, 2019.3.0b12, 2020.1.0a14
Couldn't test with: 2017.4 (Audio.AudioPlayableBinding does not exist)
Note: CustomAudioPlayableAsset Audio Track emits sound when scrubbing with "Audio Scrubbing" enabled in Timeline
Add comment
All about bugs
View bugs we have successfully reproduced, and vote for the bugs you want to see fixed most urgently.
Latest issues
- Search field in UI Builder's Library has no character limit
- Changing the value in UI Builder by dragging increases it by a few thousand points when reaching the borders of the screen
- ARM64 architecture DLL incorrectly copied instead of x64 when building for Windows x64
- Crash on TypeTreeIterator::GetNode when opening a specific folder
- Crash on WriteSerializedAssetsV2 when (re)entering the Play Mode in a specific project when IEnumerator Start() is used
Resolution Note (2020.1.X):
Timelines built-in audio track requires some internal components to work. It calls AudioClipPlayable.Seek explicitly, which you can replicate using the following modifications to the script provided.
using UnityEngine;
using UnityEngine.Audio;
using UnityEngine.Playables;
using UnityEngine.Timeline;
[CreateAssetMenu]
public class CustomAudioPlayableAsset : PlayableAsset, ITimelineClipAsset
{
public class SeekBehaviour : PlayableBehaviour
{
public AudioClipPlayable clipPlayable;
public override void OnBehaviourPlay(Playable playable, FrameData info)
{
clipPlayable.Seek(playable.GetTime(), 0);
}
public override void OnBehaviourPause(Playable playable, FrameData info)
{
clipPlayable.Pause();
}
}
public AudioClip clip;
public bool propagate;
public ClipCaps clipCaps => ClipCaps.All;
public override Playable CreatePlayable(PlayableGraph graph, GameObject owner)
{
var acp = AudioClipPlayable.Create(graph, clip, looping: false);
var sp = ScriptPlayable<SeekBehaviour>.Create(graph, 1);
sp.ConnectInput(0, acp, 0);
sp.SetInputWeight(0, 1);
sp.GetBehaviour().clipPlayable = acp;
return sp;
}
}