Every node has a Sequence field that can contain sequencer commands. These sequencer commands tell the Dialogue System to do things like play audio.
Here are the steps to connect audio to your conversations. I'll break it into two parts. The first part will get you playing audio quickly. The second part covers how to make it manageable for lots of dialogue.
Part 1:
1. Create a folder named "Resources" anywhere in your project. You can have as many Resources folders as you want in your project. For example, if you have a folder for each character, you can create a "Resources" subfolder in each character's folder.
2. Put your audio clip (e.g., mp3 file) in the Resources folder. Let's say the audio clip is named "Hello".
3. Inspect the dialogue entry node. Set the Sequence field to:
Code: Select all
AudioWait(Hello)
Part 2:
You can imagine that it would get tedious to set the Sequence field of every node if you have a lot of dialogue. That's where entrytags come in.
1. Inspect the Dialogue Manager GameObject. Set Display Settings > Camera Settings > Default Sequence to:
Code: Select all
AudioWait(entrytag)
3. On the Dialogue Editor window's Database tab, expand Export Database.
a. Untick all the checkboxes except Export Conversations. (Optional but makes the output simpler.)
b. Change the Format dropdown to Voiceover Script.
c. Click the Export... button to save the script as a csv file.
4. Open the csv file in any spreadsheet program such as MS Excel or Google Sheets. You should see that each line of dialogue has an associated entrytag such as "Player_9_42". Name your audio clips according to these entrytags (e.g., Player_9_42.mp3) and put them in Resources folder(s). (If you're sending out dialogue for voice actors, include the csv file and ask them to save the files using this naming scheme so you won't have to rename them.)
Then play the conversation. When a node's Sequence is blank, it will use the Dialogue Manager's Default Sequence. At runtime, the keyword "entrytag" in "AudioWait(entrytag)" is automatically replaced by the current node's entrytag.
If you don't want the player's responses to play audio, set the Dialogue Manager's Display Settings > Camera Settings > Default Player Sequence to:
Code: Select all
None()
Once you get this down, you can go a lot further. If you have lipsync animation, you can also use "entrytag" in the Voice() (for legacy animation) or AnimatorPlayWait() (for Mecanim) sequencer commands, such as:
Code: Select all
AudioWait(entrytag);
AnimatorPlayWait(entrytag)
The Dialogue System also integrates with other lipsync and lipsync approximation products like SALSA. With SALSA, the sequence would simply be:
Code: Select all
SALSA(entrytag)