What is the current behavior?
When an yarnspinner script contains a voiced line as the very first line of dialogue, and Addressables are in use, it will fail to play as the AudioClip will not have had time to load.
Please provide the steps to reproduce, and if possible a minimal demo of the problem:
Make sure addressables and yarn localization are enabled for your project.
Create an audioclip. Name and mark it addressable as appropriate.
Write a .yarn script such that the first line is dialogue and includes a voice #line: ID tag that matches the addressable.
Run the game and play the yarn script
What is the expected behavior?
The audio line plays, regardless of whether there is a <> or not, or is the first line or not.
Please tell us about your environment:
Yarn Spinner Version: 2.2.1
Unity Version: 2021.3.10f1
Other information
As a workaround, I made the following changes:
Fork AudioLineProvider to include a reference to itself in its own AudioLocalizedLine subclass.
Implement an AudioLineProvider.WaitForAssetLoad(lineID) to manually wait for the clip to finish loading.
Implement an AudioLineProvider.GetAudioClip(lineID) to manually retrieve the clip after finished loading.
Fork VoiceOverView to handle missing AudioClip in DoRunLine(); use the above APIs to finish waiting for and attempt to re-retrieve it before giving up.
What is the current behavior? When an yarnspinner script contains a voiced line as the very first line of dialogue, and Addressables are in use, it will fail to play as the AudioClip will not have had time to load.
Please provide the steps to reproduce, and if possible a minimal demo of the problem:
#line:
ID tag that matches the addressable.What is the expected behavior? The audio line plays, regardless of whether there is a <> or not, or is the first line or not.
Please tell us about your environment:
Other information
As a workaround, I made the following changes: