Hello AC Forums.
In order to avoid the long load times for asset bundles in my fully voiced game, I've switched over to playing speech audio by addressable. This was going great, instant availability of samples when I load up a save game, but I've hit a snag with my player character's dialogue.
I use character switching, primarily to let the user choose between a male or female voice actor. The player is set up with "use player prefab name in filenames" and "player lines have separate audio for each player?" options ticked. In the speech menu, the player's lines show both options, i.e.: Avatar_FXXX and Avatar_MXXX where XXX is the line ID as the expected filename, and the addressable "key" name is set as that same filename.
However, when a line player dialogue is encountered in the game, no voice sample plays, and the console shows the following errors:
Exception encountered in operation CompletedOperation, status=Failed, result= : Exception of type 'UnityEngine.AddressableAssets.InvalidKeyException' was thrown., Key=Player885, Type=UnityEngine.AudioClip UnityEngine.AddressableAssets.Addressables:LoadAssetAsync<UnityEngine.AudioClip> (object) Exception encountered in operation ChainOperation<AudioClip> - UnityEditor.AddressableAssets.Settings.FastModeInitializationOperation, result='', status='Succeeded', status=Failed, result= : ChainOperation of Type: UnityEngine.AudioClip failed because dependent operation failed Exception of type 'UnityEngine.AddressableAssets.InvalidKeyException' was thrown., Key=Player885, Type=UnityEngine.AudioClip
We can see here that the game seems to be looking for Player885, rather than Avatar_F885 or Avatar_M885. Changing the key to Player885, results in the audio playing, but defaulting to the Avatar_F version (the default player) regardless of whether Avatar_M is the active player.
I also tried changing the speaker label of the two players to Avatar_F and Avatar_M, but this doesn't affect it in any way I can see.
Any pointers for using the addressable speech audio system with character switching?
Cheers,
Martyn
It looks like you're new here. If you want to get involved, click one of these buttons!
Comments
Sounds like a bug, if it's searching for the wrong line.
Can you share screens of your Speech Manager's options, as well as the entry of a line that causes this issue? I'll attempt a recreation.
Will do!
Speech manager options:
https://i.imgur.com/3BySKWZ.png
The line that caused the errors above (though it does this with any and every player line):
https://i.imgur.com/iAR7NgF.png
If you need anything else, drop me a line and I'll get it to you ASAP.
Thanks, I'll let you know.
Recreated - I'll bring out a fix shortly.
Awesome.
Fixed in 1.73.5.
Hello!
I believe I have a similar issue. A text line is being repeated on the game. Therefore, I renamed the second occurrence to read the first speech audio file (to not duplicate the same audio file twice), but it keeps trying to play the original one and doesn't play it.
https://ibb.co/0c36tqn
Sorry! I solved it with the "Merge it types match option!"