Multiple voice options for Player

Announcements, support questions, and discussion for the Dialogue System.
Post Reply
brian_nielsen
Posts: 4
Joined: Wed Mar 22, 2023 12:02 pm

Multiple voice options for Player

Post by brian_nielsen »

Good morning Tony,

We've been using the entrytag system to play dialogue audio in our project. Right now we are using AudioWait(entrytag) in our default sequence.

We've got a single player RPG we're releasing on WebGL.

If we wanted to set up multiple voice options for the player how would you go about that?

We're looking to have the player choice a voice type at the character creation screen and keep that same voice throughout. The actual lines of dialogue would be the same no matter the selection, just the selected audio file would change.

I'm imagining a folder structure that holds the same file names but in separate Resources folder. Something like "Assets/Audio/PlayerOptionA/Resources/1_Player_1" ... "Assets/Audio/PlayerOptionB/Resources/1_Player_1" etc.

I'm unsure where to go from here though. Thank you for your help.
brian_nielsen
Posts: 4
Joined: Wed Mar 22, 2023 12:02 pm

Re: Multiple voice options for Player

Post by brian_nielsen »

I forgot to mention that I tried to find a similar forum post before posting myself. If there is an existing thread that points this out please feel free to link me to that instead.
User avatar
Tony Li
Posts: 21068
Joined: Thu Jul 18, 2013 1:27 pm

Re: Multiple voice options for Player

Post by Tony Li »

Hi,

There are a few ways to do it. Here are three:

1. You could put each voice option's audio files, named according to entrytag, in a separate asset bundle. For example, you might have a "BurlyBarbarian" asset bundle containing Player_7_42.wav and a "SqueakyRogue" assetbundle containing Player_7_42.wav. Then load only the player's chosen voice option, and call DialogueManager.RegisterAssetBundle() to let the Dialogue System know about it.

2. Along the lines of what you suggest, you could put the barbarian's line in Resources/Barbarian/Player_7_42.wav and the rogue's in Resources/Rogue/Player_7_42.wav. Then set a DS variable such as "PlayerVoice" to "Barbarian" or "Rogue", and use this sequencer command: AudioWait([var=PlayerVoice]/entrytag). You can also use Addressables instead of Resources and set the audio clip's addressable key to "Barbarian/Player_7_42", etc.

3. Or you could include the voice option in the audio clip's filename, such as Resources/Player_7_42_Barbarian and Resources/Player_7_42_Rogue. Then use the sequencer command: AudioWait(entrytag_[var=PlayerVoice]).
brian_nielsen
Posts: 4
Joined: Wed Mar 22, 2023 12:02 pm

Re: Multiple voice options for Player

Post by brian_nielsen »

Hi Tony,

My apologies for the late reply. Thank you so much for these. 3 perfectly clear, succinct solutions.
User avatar
Tony Li
Posts: 21068
Joined: Thu Jul 18, 2013 1:27 pm

Re: Multiple voice options for Player

Post by Tony Li »

No worries, glad to help!
Post Reply