Unleash Your Imagination: Chat GPT integrated with Unreal Engine 5

Find AI Tools in second

Find AI Tools
No difficulty
No complicated process
Find ai tools

Unleash Your Imagination: Chat GPT integrated with Unreal Engine 5

Table of Contents:

  1. Introduction
  2. Setting up the Text-to-Speech Software
  3. Implementing the Speech Conversion Function
  4. Coding the Open AI Blueprint
  5. Adjusting the Master Submix Settings
  6. Testing the Text-to-Speech Conversion
  7. Enhancing the Voice Quality
  8. Customizing the Start Sequence
  9. Bug Fix: Addressing Repeated Questions
  10. Next Steps and Conclusion

Introduction

In this episode of Bulldog games, we will Continue exploring the capabilities of our open AI Chat GPT. Specifically, we will focus on converting text into speech. While there are numerous text-to-speech software options available, we will be using the one that we found to be the easiest. So, let's dive into the process and get started!

Setting up the Text-to-Speech Software

The first step is to navigate to the project settings by clicking on the Edit menu and selecting Plugin Project Settings. In the settings window, search for "text-to-speech" and make sure that the option is enabled. If not, tick the checkbox and restart your project if necessary. Enabling this feature will provide us with a wide range of blueprint nodes that we can utilize in our implementation.

Implementing the Speech Conversion Function

To implement the text-to-speech conversion function, we need to access the blueprint where the user inputs their question. In this particular case, it is located in the HUD of the inventory widget. To start, right-click and Create a custom event named "Get Text to Speech". From there, right-click again and search for "text-to-speech engine subsystem". This will open a box from which we will need to pull off the "Activate Channel" node along with the "Get Speech Cut" and "Speak on Channel" nodes. Make sure to connect them accordingly.

Coding the Open AI Blueprint

Moving on to the Open AI blueprint, locate the sections labeled "Ask AI 101", "API Key", and "Start Sequence". Instead of stopping at the "Branch" node as discussed in the previous video, we will now connect it to a "For Each Loop" node. Within the loop, break and create a "Return Text" variable. This variable will store the returned text from the loop. Continuing with the blueprint, get the third person character, access the HUD, and call the custom event that we created earlier. This will trigger the event and allow the conversation to flow.

Adjusting the Master Submix Settings

To ensure that the speech conversion works properly, we need to make a small adjustment in the project settings. Search for "Project Settings Submix" and click on the submix option. In the "Master Submix" section, click on the edit button. This will open a blueprint where we need to uncheck a specific box that is normally checked. By unchecking it, we ensure that the speech conversion feature functions correctly.

Testing the Text-to-Speech Conversion

With all the necessary setup and coding in place, it's time to test the text-to-speech conversion. Press play and ask the AI a question, for example, "How old are You?". The AI will convert the text into speech and provide the response. Please note that the voice may sound a bit robotic, but we will address this issue in the next section. It is also worth mentioning that you can experiment with different Prompts in the start sequence to customize the conversation flow.

Enhancing the Voice Quality

If you would like to improve the voice quality, there are options available to update and modify the voice settings. Although we have not yet explored this aspect in Detail, you can make adjustments within the system to enhance the voice and make it sound more natural and pleasant to listen to.

Customizing the Start Sequence

The start sequence plays a crucial role in initiating the conversation with the AI. By default, it is set to simply "AI", indicating that the AI is waiting for a response from the player to begin the conversation. However, you can customize this sequence to suit specific scenarios or prompts. For example, if you want the AI to act as a vendor in your game, you can set the start sequence to focus on selling spaceship parts and provide Relevant information about spaceships upon inquiry.

Bug Fix: Addressing Repeated Questions

A common bug in the previous version was that it would ask the same question repeatedly. To address this issue, simply disconnect the pins that were previously connected. There is no need to plug in both of these pins. By doing so, the AI will no longer ask repeated questions and will seamlessly continue the conversation in response to new inquiries.

Next Steps and Conclusion

In this episode, we have successfully implemented the text-to-speech conversion function in our open AI chat GPT. We have covered the setup process, coding the necessary blueprints, adjusting settings, testing the conversion, enhancing the voice quality, customizing the start sequence, and fixing a bug related to repeated questions. With these steps completed, We Are now prepared to take the next leap and enable two-way communication, where our speech will be converted to text, allowing for an engaging conversation with the AI. We hope you find this information helpful and stay tuned for more exciting episodes in this series!


Highlights:

  • Learn how to convert text into speech in your open AI chat
  • Use an easy-to-implement text-to-speech software
  • Explore the available blueprint nodes for speech conversion
  • Set up the necessary functions and code in the AI blueprint
  • Adjust the master submix settings to ensure proper speech conversion
  • Test the text-to-speech conversion functionality
  • Enhance the voice quality for a better user experience
  • Customize the start sequence to initiate tailored conversations
  • Address a bug related to repeated questions
  • Prepare for two-way communication with speech-to-text conversion

Most people like

Are you spending too much time looking for ai tools?
App rating
4.9
AI Tools
100k+
Trusted Users
5000+
WHY YOU SHOULD CHOOSE TOOLIFY

TOOLIFY is the best ai tool source.

Browse More Content