For the complete documentation index, see llms.txt. This page is also available as Markdown.

📣Dialogue: Voice Audio & Subtitles

Table of Contents

Adding Subtitles to Your Gameplay

  • In order to add audio and/or subtitles to your gameplay, you'll need to export your project from Coppola.

    • Navigate to the intended project and select the blue Build project button in the top-right corner of the page. This will download a zip file to your computer. When you extract the files, you'll see a .json file (for domain assets) and a .csv file (your utterance manifest)

  • We're going to begin by creating a data table for the utterances, so open your Unreal project and navigate to whatever folder you'd like the data table to exist in.

  • Right click in the Content Browser and choose Miscellaneous → Data Table → UtteranceDataTableRow then name the asset.

Bitpart Tip: We recommend giving data table the prefix DT_ in front of the rest of the name to make it easier to find with the search functionality.

  • Open the newly created data table and switch to the Data Table Details tab. Click on the ellipses to the right of the File Path header and upload the CSV you just downloaded from Coppola. Navigate back to the Data Table tab and click Reimport. The spoken dialogue from your content should appear in the data table below.

  • Save and close out of the asset.

  • In the Content Browser right click on the data table and choose Bitpart Actions → Import Utterances. This process will create data assets for each of the characters that has spoken dialogue lines. PickTargetFolder let's you choose where exactly these assets will be placed. Choose a location and hit Import.

  • You should see new assets appear in the folder you selected. The final step to get subtitles working properly is to hook the utterance data assets up to their corresponding NPC blueprints.

    • Open each NPC blueprint, click on BP_BitpartCharacterComponent , and navigate to Details → Bitpart → Utterance. Assign the utterance data asset in the Bitpart Utterance Data Asset field.

    • Compile, save, and close out of the asset.

    • Follow this step for all NPCs with dialogue lines.

Adding Audio to Your Gameplay

Bitpart NPCs do not come with placeholder voice files, but you can easily add your own.

Creating a Folder for the Audio

  • Create a folder on your computer for the audio files and give it a name.

  • Drag the utterance CSV file generated in the last step into the folder you just created. If you open the CSV you will see it contains a list of all the dialogue lines in your project. The last column in this spreadsheet is named file name. This field is asking for the file path on your computer where the audio recording of that line is stored. We don't need to do anything with it yet. Close the CSV file.

Setup

  • Clone the Bitpart-cli public repo: https://github.com/bitpart-ai/bitpart-cli.

  • Open Windows PowerShell.

  • Change the directory to the bitpart-cli repo. Find the repo in File Explorer, copy the path, and type cd with the path pasted directly after it. If there are any spaces in the path, you'll need to use quotations around it. It might look something like this: cd "C:\unreal repos\bitpart-cli" . Hit Enter.

  • Create a virtual environment. This keeps packages in the project and avoids Windows long-path issues.

  • Type this command and hit enter: python -m venv venv

  • Type this command hit enter: .\venv\Scripts\Activate.ps1

  • Your prompt will show (venv) in green when it's active.

  • Install dependencies by entering this command: pip install -e .

  • The Bitpart-CLI repo includes a file called .env.local. Open it. This file stores your API key for ElevenLabs or Inworld. Input your API key for the provider you want to use.

Assign Voice IDs to Characters

  • In the power shell type: bitpart tts "path\to\utterances.csv" --project Tutorial --init --provider inworld

    • Replace "path\to\utterances.csv" with the path to the utterances file in the folder you created. If you right click on the utterances CSV and select copy as file path you can past that path directly into the power shell.

    • If you are using Elevenlabs, replace the word inworld after provider with elevenlabs.

  • Hit enter. This command scans the utterances CSV file, collects unique character_name values, and writes a skeleton character_voices.json file with empty voice_ids you can fill in. This file will be added to your audio folder as well.

  • Open your character_voices.json file. There will be a section of the file for each NPC who has dialogue in your project and a space to fill in the voice ID you would like to use. Here's an example of what it could look like:

Generate Audio Files

  • In the power shell, type bitpart tts "path\to\utterances.csv" --project Tutorial --provider inworld Remember to replace "path\to\utterances.csv" with the path to your utterances CSV, and if you're using ElevenLabs, replace Inworld with elevenlabs. If you want to verify that everything is set up correctly before running the full generation process, append --limit 1 to the command.

  • Hit Enter. This command will call Inworld’s API and generate audio files for each line, using the voices specified in your character voices JSON file. As soon as generation is complete, you’ll see a message confirming how many lines were generated and how many, if any, failed to generate.

  • Open your audio folder. You should see all the generated audio files in this folder. Open the CSV file and note that the CSV has been updated to include the file paths for each audio file.

Update Data Assets in Unreal

  • Go back into your Unreal project. In the Content Browser, navigate to the folder where your utterance data table lives. If you have not created one yet, follow these instructions.

  • Open the data table. Switch tabs to the Data Table Details. Under source file point the source file at the version of your utterances CSV that you just created. Click Reimport. Save and close the asset.

  1. Right click on the utterance data table and select the Bitpart action Import Utterances. Select a folder as the target folder and click Import Utterances.

  2. Once the import completes, you’ll see new sub folders have been added to the folder you chose, one for each NPC with dialogue lines. If you click into each one you’ll see the audio files for each line have been added.

Click Play to see your content running with audio.

Last updated