I created a timeline that has a audioTrack in script.
var timelineAsset = ScriptableObject.CreateInstance<TimelineAsset>();
var audioTrack = timelineAsset.CreateTrack<AudioTrack>("audio");
audioTrack.CreateClip(audioClip);
and it works great until I open timeline window in editor.
It has endless same errors like below
ArgumentException: Clip testClip (UnityEngine.AudioClip)'s overview preview is null
UnityEditor.StreamedAudioClipPreview+ClipPreviewDetails…ctor (UnityEngine.AudioClip clip, System.Boolean isLooping, System.Int32 size, System.Double localStart, System.Double localLength) (at /Users/builduser/buildslave/unity/build/Editor/Mono/Audio/StreamedAudioClipPreview.cs:64
I searched the error for a few hours and nothing were helpful to me… Do you guys have any clue?
I assume the problem is caused by the audio clip is from audio file in streamingAsset Folder which is read with UnityWebRequest.
The editor is having problem because it is not an preloaded asset maybe?
Yes, that appears to be the problem. For preview, the audio clip is required to be in the AssetDatabase.
@seant_unity Is there any plan to fix this?
or do you have any idea to load those file to AssetDatabase at least only in Editor?
I found the problem is here in AudioPlayableAssetEditor.cs. I just commented this line out since I don’t need audio tracks’ detail now.
This so poor solution because I have to comment this part in Library/PackageCache/com.unity.timeline@1.4.1. and I have to redo this every time the cache changes.
I hope better solution will be found soon.
We don’t currently have a plan to fix this because this is the first time we’ve seen this issue. Are you able to file a bug with your repro case? That would allow it to get fixed by the appropriate team - the appropriate fix may not be in timeline.
As for your temporary workaround, copy Library/PackageCache/com.unity.timeline@1.4.1 into Packages/com.unity.timeline. That will make timeline be a local package, and you can make the changes you need to without worrying about the package cache. If there a new version of timeline, then you would need to your redo changes. However, if your package folder is in source control, then that too can also be managed easier.
It is the first time to me to report something and I’m not sure I did it right, but I submitted a bug report(Case 1268868). Thank you for the workaround.