ZeroMirai / Waifu_AI_Vtuber

Waifu_AI_Vtuber is a AI virtual YouTuber chatbot powered by OpenAI GPT-3.5, interacting in real-time with YouTube live chat and converting responses into Japanese audio using VoiceVox. Create multilingual subtitles and customize character prompts.
MIT License
16 stars 1 forks source link
ai ai-vtuber live-2d openai python speech-synthesis text-to-speech voicevox vtuber waifu

Waifu_AI_Vtuber

Waifu_AI_Vtuber is a Python-based AI virtual YouTuber chatbot. The chatbot interacts with live YouTube chat, processes the messages, generates responses using the OpenAI GPT-3.5 model, and provides text-to-speech audio output for responses using VoiceVox engine.

Example Image

Table of Contents

Features

Prerequisites

Installation

  1. Download OBS, Vtuber studio, EarTrumpet, VoiceMeeter banana(after you install VoiceMeeter banana you'll also need to restart your PC) and open VoiceVox.

  2. For VoiceMeeter banana, we need to change voice output and voice input first.

    1. Open the Control Panel by pressing the Windows key and typing Control Panel. In the upper right corner, click on View by and select Large icon.

      guide_1 guide_2

    2. Click on Sound, scroll down until you see VoiceMeeter Input, and then click on it. Finally, click Set Default.

      guide_3 guide_4

    3. Click on Recording at the top, scroll down until you see VoiceMeeter Aux Output, click on it, and then click Set Default.

      guide_5 guide_6

    4. The first time the program is opened, it would look like this.

      guide_7

    5. Click on each A1 to deselect them on all five panels. Similarly, do the same with B1. It should now look like this.

      guide_8 guide_9

    6. On the upper right corner, click on A1 and select your speaker output (WDM is recommended).

      guide_10 guide_11

    7. Now, click on A1 for all VIRTUAL INPUTS. However, for VOICEMEETER AUX, you'll also need to click on B1.

      guide_12

  3. For Vtuber Studio.

    1. Open the settings by double-clicking on the screen and then click on the gear icon located on the left side.

      guide_13

    2. Scrolldown until you see Microphone Setting check Use microphone and select VoiceMeeter Output (VB-Audio VoiceMeeter VAIO) by clicking on the Microphone.

      guide_14 guide_15

    3. Go to Model setting at the top left corner(a people icon with a gear). Scroll down until you see Mouth Open. Click on input and select or type VoiceVolumePlusMouthOpen.

      guide_16 guide_17 guide_18

    4. Optional: In Microphone Setting, I recommend setting Volume gain to 20 and everything else is set to 0.

  4. For OBS, we'll add subtitles to display the text, and for Vtuber studio, we'll use it to show Live2D.

    1. To add a subtitle, press + in the source, select Text(GDI+), and name it as Subtitle.

      guide_19 guide_20

    2. After adding the text source, a window will appear like this. You'll need to check Read from file and then click Browse.

      guide_21 guide_22

    3. Navigate to subtitle.txt, which is located inside the text_log folder, and select it.

      guide_23

    4. Customize and configure the subtitle file according to your preferences, (For my recommendation, I suggest reducing the size of the text, setting Alignment to center and Verticle alignment to center, right-clicking on the text, navigating to Tranform and selecting Center Horizontally. Also, check Outline, set the outline size to 10-14, and change the outline color to black by clicking on Select color).

      guide_24 guide_25 guide_26

    5. To add Vtuber Studio, press + in the source, select Window Capture and name it as Live2D

      guide_27 guide_28

    6. After adding the video source, a window will appear like this. Click on Window, select [VTube Studio.exe]: VTube Studio, on Capture Method choose Windows 10 (1903 and up), and then click OK.

      guide_29 guide_30

    7. Right-click on the preview screen, choose Windowed Projector (Preview), and resize it as your desire.

      guide_31

  5. Running the code, open EarTrumpet and scroll down to the bottom you'll see VoiceMeeter Input (VB-Audio VoiceMeeter VAIO), right click on Python 3.11.xx and click on change icon, select VoiceMeeter Aux Input (VB-Audio VoiceMeeter AUX VAIO).

    guide_33 guide_34 guide_35

  6. Change your playback/output device by clicking on the speaker icon on the taskbar (or go to window setting -> System -> Sound -> Choose your output device). Select VoiceMeeter Aux Input (VB-Audio VoiceMeeter AUX VAIO) first and then selcet VoiceMeeter Input (VB-Audio VoiceMeeter VAIO) (we need to do this process to let Python recognize these playback devices).

    guide_36 guide_37

  7. In Vtuber Studio, open the settings, navigate to Microphone Setting and click on Reload.

  8. Download the project zip file from GitHub or Clone this repository by typing these in terminal or command prompt (but if you choose to download the project as a zip file you'll also need to extract the zip file).

    git clone https://github.com/ZeroMirai/VirtuAI-Helper.git
  9. Open a terminal or command prompt and change the directory to the project folder by typing cd followed by where this folder is located for example cd C:\Git_hub\VirtuAI Helper.

  10. Install all necessary library by typing.

    pip install -r requirements.txt
  11. Configure the necessary API keys and other config in config.txt.

File Structure

Configuration

Before running the program, Ensure you have changed all the configurations and pasted them right after the : in the file. The file must have the following format.

Usage

  1. Open VoiceVox engine.
  2. Open run_main_script.bat and run_read_chat_script.bat.

Contributing

Actually, this is a project that's made just for fun but if you are interested to contribute in this project here is how you can make this project better for everyone:

Bug Reports and Feature Requests

If you found a bug or have an idea for a new feature, feel free to requests and reports by open an issue on GitHub and post it if it's a bug please give as much detail as possible or suggest an idea please include a step or a clear description.

Pull Requests

If you have suggestions or improvements.

  1. Fork the repository and create your own branch from main.
  2. Work on your changes.
  3. Write clear, concise commit messages that describe the purpose of your changes.
  4. Open a pull request and provide a detailed description of your changes.

I'm primarily looking for code improvements and bug fixes. Once your changes are approved, they will be merged into the main project.

⭐ Share and Give a Star ⭐

If you find this project useful I would be really grateful if you could consider sharing this small project with others and giving it a star on GitHub.


Note

License

This project is licensed under the MIT License.

Credits

Special thanks to Neuro-sama, who inspired me to start learning how to code and create my own waifu.