Giter Site home page Giter Site logo

ardha27 / ai-waifu-vtuber Goto Github PK

View Code? Open in Web Editor NEW
700.0 25.0 122.0 6.35 MB

AI Vtuber for Streaming on Youtube/Twitch

Python 99.92% Batchfile 0.08%
deepl openai speech-recognition speech-synthesis speech-to-text tts vtuber whisper ai-vtuber ai-waifu

ai-waifu-vtuber's Introduction

Support

ko-fi

Update

v3.5 Now it also supports for Twitch Streamer

v3.0 Now not only supports Japanese TTS using VoiceVox. But also supports TTS for RU (Russian), EN (English), DE (German), ES (Spanish), FR (French), TT (Tatar), UA (Ukrainian), UZ (Uzbek), XAL (Kalmyk), Indic (Hindi), using Seliro TTS. Change voicevox_tts on run.py to seliro_tts, for detailed information of how to use Seliro TTS

AI Waifu Vtuber & Assistant

This project is inspired by shioridotdev and utilizes various technologies such as VoiceVox Engine, DeepL, Whisper OpenAI, Seliro TTS and VtubeStudio to create an AI waifu virtual YouTuber.

My Remote Image

Demo

Technologies Used

Installation

  1. Install the dependencies
pip install -r requirements.txt
  1. Create config.py and store your Openai API key
api_key = 'yourapikey'
  1. Change the owner name
owner_name = "Ardha"

if you want to use it for livestream, create a list of users that you want to blacklist on run.py

blacklist = ["Nightbot", "streamelements"]
  1. Change the lore or identity of your assistant. Change the txt file at characterConfig\Pina\identity.txt

  2. If you want to stream on Twitch you need to change the config file at utils/twitch_config.py. Get your token from Here. Your token should look something like oauth:43rip6j6fgio8n5xly1oum1lph8ikl1 (fake for this tutorial). After you change the config file, you can start the program using Mode - 3

server = 'irc.chat.twitch.tv'
port = 6667
nickname = 'testing' # You don't need to change this
token = 'oauth:43rip6j6fgio8n5xly1oum1lph8ikl1' # get it from https://twitchapps.com/tmi/.
user = 'ardha27' # Your Twitch username
channel = '#aikohound' # The channel you want to retrieve messages from
  1. Choose which TTS you want to use, VoiceVox or Silero. Uncomment and Comment to switch between them
# Choose between the available TTS engines
# Japanese TTS
voicevox_tts(tts)

# Silero TTS, Silero TTS can generate English, Russian, French, Hindi, Spanish, German, etc. Uncomment the line below. Make sure the input is in that language
# silero_tts(tts_en, "en", "v3_en", "en_21")

If you want to use VoiceVox, you need to run VoiceVox Engine first. You can run them on local using VoiceVox Docker or on Google Colab using VoiceVox Colab. If you use the Colab one, change voicevox_url on utils\TTS.py using the link you get from Colab.

voicevox_url = 'http://localhost:50021'

if you want to see the voice list of VoiceVox you can check this VoiceVox and see the speaker id on speaker.json then change it on utils/TTS.py. For Seliro Voice sample you can check this Seliro Samples

  1. Choose which translator you want to use depends on your use case (optional if you need translation for the answers). Choose between google translate or deeplx. You need to convert the answer to Japanese if you want to use VoiceVox, because VoiceVox only accepts input in Japanese. The language answer from OpenAI will depens on your assistant lore language characterConfig\Pina\identity.txt and the input language
tts = translate_deeplx(text, f"{detect}", "JA")
tts = translate_google(text, f"{detect}", "JA")

DeepLx is free version of DeepL (No API Key Required). You can run Deeplx on docker, or if you want to use the normal version of deepl, you can make the function on utils\translate.py. I use DeepLx because i can't register on DeepL from my country. The translate result from DeepL is more accurate and casual than Google Translate. But if you want the simple way, just use Google Translate.

  1. If you want to use the audio output from the program as an input for your Vtubestudio. You will need to capture your desktop audio using Virtual Cable and use it as input on VtubeStudio microphone.

  2. If you planning to use this program for live streaming Use chat.txt and output.txt as an input on OBS Text for Realtime Caption/Subtitles

FAQ

  1. Error Transcribing Audio
def transcribe_audio(file):
    global chat_now
    try:
        audio_file= open(file, "rb")
        # Translating the audio to English
        # transcript = openai.Audio.translate("whisper-1", audio_file)
        # Transcribe the audio to detected language
        transcript = openai.Audio.transcribe("whisper-1", audio_file)
        chat_now = transcript.text
        print ("Question: " + chat_now)
    except:
        print("Error transcribing audio")
        return

    result = owner_name + " said " + chat_now
    conversation.append({'role': 'user', 'content': result})
    openai_answer()

Change this Line of Code to this. This will help you to get more information about the error

def transcribe_audio(file):
    global chat_now
    audio_file= open(file, "rb")
    # Translating the audio to English
    # transcript = openai.Audio.translate("whisper-1", audio_file)
    # Transcribe the audio to detected language
    transcript = openai.Audio.transcribe("whisper-1", audio_file)
    chat_now = transcript.text
    print ("Question: " + chat_now)


    result = owner_name + " said " + chat_now
    conversation.append({'role': 'user', 'content': result})
    openai_answer()

Another option to solve this problem, you can upgrade the OpenAI library to the latest version. Make sure the program capture your voice/sentence, try to hear the input.wav

  1. Mecab Error

this library is a little bit tricky to install. If you facing this problem, you can just delete and don't use the katakana_converter on utils/TTS.py. That function is optional, you can run the program without it. Delete this two line on utils/TTS.py

from utils.katakana import *
katakana_text = katakana_converter(tts)

and just pass the tts to next line of the code

params_encoded = urllib.parse.urlencode({'text': tts, 'speaker': 46})

Credits

This project is inspired by the work of shioridotdev. Special thanks to the creators of the technologies used in this project including VoiceVox Engine, DeepL, Whisper OpenAI, and VtubeStudio.

ai-waifu-vtuber's People

Contributors

ardha27 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

ai-waifu-vtuber's Issues

Translate and __init__.py problem

Hello this is me again, Im sry but there's a problem with the translator, the translator didn't translate for example:
"Hello" it translate to "you" or "How are you?" it translate to "Thank you"
This happen after I restart my computer, before I restart my computer the translator seems normal.

init.py problem:
This is also apeared after I restart my computer, Error log:

Press and Hold Right Shift to record audio
Recording...
Stopped recording.
Question:
Traceback (most recent call last):
File "C:\oof\AI\AI-Waifu-Vtuber-master\run.py", line 211, in
File "C:\oof\AI\AI-Waifu-Vtuber-master\run.py", line 67, in record_audio
transcribe_audio("input.wav")
File "C:\oof\AI\AI-Waifu-Vtuber-master\run.py", line 83, in transcribe_audio
result = translate_google(chat_now, "ID", "EN")
File "C:\oof\AI\AI-Waifu-Vtuber-master\translate.py", line 39, in translate_google
result = translator.translate(text, src=source, dest=target)
File "C:\Users\asus\AppData\Local\Programs\Python\Python310\lib\site-packages\googletrans\client.py", line 219, in translate
parsed = json.loads(data[0][2])
File "C:\Users\asus\AppData\Local\Programs\Python\Python310\lib\json_init_.py", line 339, in loads
raise TypeError(f'the JSON object must be str, bytes or bytearray not NoneType'
TypeError: the JSON object must be str, bytes or bytearray not NoneTypenot NoneType

I tried to reexecute .\run.py, the error showed up again, but this time "not NoneTyp" was duplicated :
First error log :
TypeError: the JSON object must be str, bytes or bytearray not NoneTypenot NoneType
Second error log :
TypeError: the JSON object must be str, bytes or bytearray not NoneTypenot NoneTypenot NoneType

And repeated, any Idea what happen?

requirements.txt didn't complete

So, I got this problem when trying to install the requirements.txt file on VS code.

ERROR: Could not find a version that satisfies the requirement torch==1.12.1 (from versions: 2.0.0) ERROR: No matching distribution found for torch==1.12.1

Do the code is still using 1.12.1? if so how can I download the older version of Torch?

Also on the config.py do I only have to put "api_key" from open ai? or are there other codes?

Problem on silero tts

Im trying to use the tts under silero on spanish mode, i already defined the spanish variable and assigned the 4 parameters to the silero tts but when it tries to give me a response it shows the error

AssertionError: speaker should be in en_0, en_1, en_2, en_3, en_4, en_5, en_6, en_7, en_8, en_9, en_10, en_11, en_12, en_13, en_14, en_15, en_16, en_17, en_18, en_19, en_20, en_21, en_22, en_23, en_24, en_25, en_26, en_27, en_28, en_29, en_30, en_31, en_32, en_33, en_34, en_35, en_36, en_37, en_38, en_39, en_40, en_41, en_42, en_43, en_44, en_45, en_46, en_47, en_48, en_49, en_50, en_51, en_52, en_53, en_54, en_55, en_56, en_57, en_58, en_59, en_60, en_61, en_62, en_63, en_64, en_65, en_66, en_67, en_68, en_69, en_70, en_71, en_72, en_73, en_74, en_75, en_76, en_77, en_78, en_79, en_80, en_81, en_82, en_83, en_84, en_85, en_86, en_87, en_88, en_89, en_90, en_91, en_92, en_93, en_94, en_95, en_96, en_97, en_98, en_99, en_100, en_101, en_102, en_103, en_104, en_105, en_106, en_107, en_108, en_109, en_110, en_111, en_112, en_113, en_114, en_115, en_116, en_117, random

Like its trying to get the english form instead of the spanish one , this is how i have it setup

silero

Pip & Run

When i try to "pip install -r requirements.txt"it installs half of them then gives me errors for the rest such as PYAudio, and whenever i do "python run.py" it says line 8 in module import keyboard, No module named keyboard.

image_2023-04-09_080430276
image_2023-04-09_080449431

NameError: name 'detect_google' is not defined

File "c:\Users\PC\Desktop\버튜버\run.py", line 209, in
record_audio()
File "c:\Users\PC\Desktop\버튜버\run.py", line 64, in record_audio
transcribe_audio("input.wav")
File "c:\Users\PC\Desktop\버튜버\run.py", line 83, in transcribe_audio
openai_answer()
File "c:\Users\PC\Desktop\버튜버\run.py", line 119, in openai_answer
translate_text(message)
File "c:\Users\PC\Desktop\버튜버\run.py", line 151, in translate_text
detect = detect_google(text)
NameError: name 'detect_google' is not defined

how can I fix it..

exceeded your current quota

Hi, When running the program and selecting mode 1 (Microphone), I encounter this error: 'Error transcribing audio: You exceeded your current quota, please check your plan and billing details.'
How do I fix it?

{skill issue}

I'll admit I have next to no clue what I'm doing.

I was installing the dependencies and got an error when installing pyaudio which I apparently already had. I threw together what the terminal said right here:
log.txt

If this is something I can ignore, then I ran into a few more issues as I already tried this.
After attempting to run the program, it gives me an error saying no module found in line 12 named 'config'.

I should note I'm using PowerShell to do all of this, is that among my problems at all?

Sorry in advance

Newer version?

Hey, seems like there's a new version for the run script, I tried to reinstall it because I have transcribe error before, now I tried to install the new one but cant find any function for VoiceVox Colab and "emoji" module? any help for this?

Voicevox on colab

Help please : /

Traceback (most recent call last):
File "I:\python\AI-Waifu-Vtuber-master\AI-Waifu-Vtuber-master\run.py", line 244, in
record_audio()
File "I:\python\AI-Waifu-Vtuber-master\AI-Waifu-Vtuber-master\run.py", line 68, in record_audio
transcribe_audio("input.wav")
File "I:\python\AI-Waifu-Vtuber-master\AI-Waifu-Vtuber-master\run.py", line 87, in transcribe_audio
openai_answer()
File "I:\python\AI-Waifu-Vtuber-master\AI-Waifu-Vtuber-master\run.py", line 120, in openai_answer
translate_text(message)
File "I:\python\AI-Waifu-Vtuber-master\AI-Waifu-Vtuber-master\run.py", line 199, in translate_text
voicevox_tts(tts)
File "I:\python\AI-Waifu-Vtuber-master\AI-Waifu-Vtuber-master\utils\TTS.py", line 38, in voicevox_tts
request = requests.post(f'{voicevox_url}/synthesis?{params_encoded}', json=request.json())
File "I:\python\AI-Waifu-Vtuber-master\AI-Waifu-Vtuber-master\env\lib\site-packages\requests\models.py", line 975, in json
raise RequestsJSONDecodeError(e.msg, e.doc, e.pos)
requests.exceptions.JSONDecodeError: Expecting value: line 1 column 1 (char 0)

why i still got this even though i dont have that line

PS C:\Users\60107\Downloads\AI-Waifu-Vtuber-master> python .\run.py
Traceback (most recent call last):
File "C:\Users\60107\Downloads\AI-Waifu-Vtuber-master\run.py", line 14, in
from utils.TTS import *
File "C:\Users\60107\Downloads\AI-Waifu-Vtuber-master\utils\TTS.py", line 5, in
from utils.katakana import *
File "C:\Users\60107\Downloads\AI-Waifu-Vtuber-master\utils\katakana.py", line 1, in
import MeCab
File "C:\Users\60107\AppData\Roaming\Python\Python311\site-packages\MeCab_init_.py", line 10, in
from . import _MeCab
ImportError: DLL load failed while importing _MeCab: The specified module could not be found.
PS C:\Users\60107\Downloads\AI-Waifu-Vtuber-master>

Nothing happens after selecting mode number 3 [twitch chat]

as stated in the title i'm not getting any prompt after selecting option number 3. Tried typing in my chat but nothing shows up in the command lines. I have tried to remove try-except to see if i get any error codes but still the same. Everything should be setup correctly since i've been following the tutorial. I have tried using mode 1 and that worked perfectly fine havent tried mode 2 yet since i'm probably not gonna use that.

Currently using latest version of Anaconda to launch the commands

image

image

sorry for distrub you creator but i will that other one since this other question

i done the voice vox in locally

C:\Users\60107>docker run --rm -it -p 50021:50021 voicevox/voicevox_engine:cpu-ubuntu20.04-latest

  • cat /opt/voicevox_engine/README.md

許諾内容

  1. 商用・非商用問わず利用することができます
  2. アプリケーションに組み込んで再配布することができます
  3. 作成された音声を利用する際は、各音声ライブラリの規約に従ってください
  4. 作成された音声の利用を他者に許諾する際は、当該他者に対し本許諾内容の 3 及び 4 の遵守を義務付けてください

音声ライブラリの利用規約

四国めたん

四国めたんの音声ライブラリを用いて生成した音声は、
「VOICEVOX:四国めたん」とクレジットを記載すれば、商用・非商用で利用可能です。

利用規約の詳細は以下をご確認ください。
https://zunko.jp/con_ongen_kiyaku.html

ずんだもん

ずんだもんの音声ライブラリを用いて生成した音声は、
「VOICEVOX:ずんだもん」とクレジットを記載すれば、商用・非商用で利用可能です。

利用規約の詳細は以下をご確認ください。
https://zunko.jp/con_ongen_kiyaku.html

春日部つむぎ

春日部つむぎの音声ライブラリを用いて生成した音声は、
「VOICEVOX:春日部つむぎ」とクレジットを記載すれば、商用・非商用で利用可能です。

利用規約の詳細は以下をご確認ください。
https://tsumugi-official.studio.site/rule

波音リツ

波音リツの音声ライブラリを用いて生成した音声は、
「VOICEVOX:波音リツ」とクレジットを記載すれば、商用・非商用で利用可能です。

利用規約の詳細は以下をご確認ください。
http://canon-voice.com/kiyaku.html

玄野武宏

玄野武宏の音声ライブラリを用いて生成した音声は、
「VOICEVOX:玄野武宏」とクレジットを記載すれば、商用・非商用で利用可能です。

利用規約の詳細は以下をご確認ください。
https://virvoxproject.wixsite.com/official/voicevoxの利用規約

白上虎太郎

白上虎太郎の音声ライブラリを用いて生成した音声は、
「VOICEVOX:白上虎太郎」とクレジットを記載すれば、商用・非商用で利用可能です。

利用規約の詳細は以下をご確認ください。
https://virvoxproject.wixsite.com/official/voicevoxの利用規約

青山龍星

個人が青山龍星の音声ライブラリを用いて生成した音声は、
「VOICEVOX:青山龍星」とクレジットを記載すれば、商用・非商用で利用可能です。
ただし企業が携わる形で利用する場合は、「ななはぴ(https://v.seventhh.com/contact/)」に対し事前確認を取る必要があります。

利用規約の詳細は以下をご確認ください。
https://virvoxproject.wixsite.com/official/voicevoxの利用規約

冥鳴ひまり

冥鳴ひまりの音声ライブラリを用いて生成した音声は、
「VOICEVOX:冥鳴ひまり」とクレジットを記載すれば、商用・非商用で利用可能です。

利用規約の詳細は以下をご確認ください。
https://meimeihimari.wixsite.com/himari/terms-of-use

九州そら

九州そらの音声ライブラリを用いて生成した音声は、
「VOICEVOX:九州そら」とクレジットを記載すれば、商用・非商用で利用可能です。

利用規約の詳細は以下をご確認ください。
https://zunko.jp/con_ongen_kiyaku.html

もち子さん

もち子さんの音声ライブラリを用いて生成した音声は、
「VOICEVOX:もち子(cv 明日葉よもぎ)」とクレジットを記載すれば、
音声作品・音声素材・ゲーム作品を除いて商用・非商用で利用可能です。

利用規約の詳細は以下をご確認ください。
https://vtubermochio.wixsite.com/mochizora/利用規約

剣崎雌雄

剣崎雌雄の音声ライブラリを用いて生成した音声は、
「VOICEVOX:剣崎雌雄」とクレジットを記載すれば、商用・非商用で利用可能です。

利用規約の詳細は以下をご確認ください。
https://frontier.creatia.cc/fanclubs/413/posts/4507

WhiteCUL

WhiteCUL の音声ライブラリを用いて生成した音声は、
「VOICEVOX:WhiteCUL」とそれぞれクレジットを記載すれば、商用・非商用で利用可能です。

利用規約の詳細は以下をご確認ください。
https://www.whitecul.com/guideline

後鬼

個人が後鬼の音声ライブラリを用いて生成した音声は、
「VOICEVOX:後鬼」とクレジットを記載すれば、商用・非商用で利用可能です。
ただし企業が携わる形で利用する場合は、「【鬼っ子ハンターついなちゃん】プロジェクト(https://ついなちゃん.com/mail/)」に対し事前確認を取る必要があります。

利用規約の詳細は以下をご確認ください。
https://ついなちゃん.com/voicevox_terms/

No.7

個人が No.7 の音声ライブラリを用いて生成した音声は、
「VOICEVOX:No.7」とクレジットを記載すれば、非商用(同人利用や配信による収入は OK)で利用可能です。
その他商用利用の場合は、「No.7 製作委員会(https://voiceseven.com/)」に対し事前確認を取る必要があります。

利用規約の詳細は以下をご確認ください。
https://voiceseven.com/#j0200

ちび式じい

ちび式じいの音声ライブラリを用いて生成した音声は、
「VOICEVOX:ちび式じい」とクレジットを記載すれば、商用・非商用で利用可能です。

利用規約の詳細は以下をご確認ください。
https://docs.google.com/presentation/d/1AcD8zXkfzKFf2ertHwWRwJuQXjNnijMxhz7AJzEkaI4

櫻歌ミコ

櫻歌ミコの音声ライブラリを用いて生成した音声は、
「VOICEVOX:櫻歌ミコ」とクレジットを記載すれば、商用・非商用で利用可能です。

利用規約の詳細は以下をご確認ください。
https://voicevox35miko.studio.site/rule

小夜/SAYO

小夜/SAYO の音声ライブラリを用いて生成した音声は、
「VOICEVOX:小夜/SAYO」とクレジットを記載すれば、商用・非商用で利用可能です。

利用規約の詳細は以下をご確認ください。
https://316soramegu.wixsite.com/sayo-official/guideline

ナースロボ_タイプT

ナースロボ_タイプTの音声ライブラリを用いて生成した音声は、
「VOICEVOX:ナースロボ_タイプT」とクレジットを記載すれば、商用・非商用で利用可能です。

利用規約の詳細は以下をご確認ください。
https://www.krnr.top/rules

†聖騎士 紅桜†

†聖騎士 紅桜†の音声ライブラリを用いて生成した音声は、
「VOICEVOX:†聖騎士 紅桜†」とクレジットを記載すれば、商用・非商用で利用可能です。

利用規約の詳細は以下をご確認ください。
https://commons.nicovideo.jp/material/nc296132

雀松朱司

雀松朱司の音声ライブラリを用いて生成した音声は、
「VOICEVOX:雀松朱司」とクレジットを記載すれば、商用・非商用で利用可能です。

利用規約の詳細は以下をご確認ください。
https://virvoxproject.wixsite.com/official/voicevoxの利用規約

麒ヶ島宗麟

麒ヶ島宗麟の音声ライブラリを用いて生成した音声は、
「VOICEVOX:麒ヶ島宗麟」とクレジットを記載すれば、商用・非商用で利用可能です。

利用規約の詳細は以下をご確認ください。
https://virvoxproject.wixsite.com/official/voicevoxの利用規約

禁止事項

  • 逆コンパイル・リバースエンジニアリング及びこれらの方法の公開すること
  • 製作者または第三者に不利益をもたらす行為
  • 公序良俗に反する行為

免責事項

本ソフトウェアにより生じた損害・不利益について、製作者は一切の責任を負いません。

その他

ご利用の際は VOICEVOX を利用したことがわかるクレジット表記が必要です。

  • exec gosu user /opt/python/bin/python3 ./run.py --voicelib_dir /opt/voicevox_core/ --runtime_dir /opt/onnxruntime/lib --host 0.0.0.0
    Warning: cpu_num_threads is set to 0. ( The library leaves the decision to the synthesis runtime )
    INFO: Started server process [1]
    INFO: Waiting for application startup.
    reading /home/user/.local/share/voicevox-engine-dev/.tmp.dict_csv-dad18be8-87ce-4fe7-903b-9cc748494526 ... 57
    emitting double-array: 100% |###########################################|

done!
INFO: Application startup complete.
INFO: Uvicorn running on http://0.0.0.0:50021 (Press CTRL+C to quit)

and i run like you did in vidoe
PS C:\Users\60107\Downloads\AI-Waifu-Vtuber-master> python .\run.py
Mode (1-Mic, 2-Youtube Live, 3-Twitch Live): 1
Press and Hold Right Shift to record audio
Recording...
Stopped recording.
Question: Hello.
JP Answer: やあ。
Traceback (most recent call last):
File "C:\Users\60107\Downloads\AI-Waifu-Vtuber-master\run.py", line 246, in
record_audio()
File "C:\Users\60107\Downloads\AI-Waifu-Vtuber-master\run.py", line 68, in record_audio
transcribe_audio("input.wav")
File "C:\Users\60107\Downloads\AI-Waifu-Vtuber-master\run.py", line 87, in transcribe_audio
openai_answer()
File "C:\Users\60107\Downloads\AI-Waifu-Vtuber-master\run.py", line 123, in openai_answer
translate_text(message)
File "C:\Users\60107\Downloads\AI-Waifu-Vtuber-master\run.py", line 201, in translate_text
voicevox_tts(tts)
File "C:\Users\60107\Downloads\AI-Waifu-Vtuber-master\utils\TTS.py", line 35, in voicevox_tts
params_encoded = urllib.parse.urlencode({'text': katakana_text, 'speaker': 46})
^^^^^^^^^^^^^
NameError: name 'katakana_text' is not defined

and still got this

Failed building wheel for PyAudio

tried 3 times and failed all 3 times. first is just following the installation process but didnt work. then i pip install PyAudio and tried again whick also didnt work

INFO: pip is looking at multiple versions of httpx[http2] to determine which version is compatible with other requirements. This could take a while.
Collecting httpx[http2] (from pytchat==0.5.5->-r requirements.txt (line 9))
Using cached httpx-0.23.3-py3-none-any.whl (71 kB)
Using cached httpx-0.23.2-py3-none-any.whl (86 kB)
Using cached httpx-0.23.1-py3-none-any.whl (84 kB)
Using cached httpx-0.23.0-py3-none-any.whl (84 kB)
Using cached httpx-0.22.0-py3-none-any.whl (84 kB)
Using cached httpx-0.21.3-py3-none-any.whl (83 kB)
Using cached httpx-0.21.2-py3-none-any.whl (83 kB)
INFO: pip is looking at multiple versions of httpx[http2] to determine which version is compatible with other requirements. This could take a while.
Using cached httpx-0.21.1-py3-none-any.whl (83 kB)
Using cached httpx-0.21.0-py3-none-any.whl (83 kB)
Using cached httpx-0.20.0-py3-none-any.whl (82 kB)
Using cached httpx-0.19.0-py3-none-any.whl (77 kB)
Using cached httpx-0.18.2-py3-none-any.whl (76 kB)
INFO: This is taking longer than usual. You might need to provide the dependency resolver with stricter constraints to reduce runtime. See https://pip.pypa.io/warnings/backtracking for guidance. If you want to abort this run, press Ctrl + C.
Using cached httpx-0.18.1-py3-none-any.whl (75 kB)
Using cached httpx-0.18.0-py3-none-any.whl (75 kB)
Using cached httpx-0.17.1-py3-none-any.whl (68 kB)
Using cached httpx-0.17.0-py3-none-any.whl (68 kB)
Using cached httpx-0.16.1-py3-none-any.whl (65 kB)
Using cached httpx-0.16.0-py3-none-any.whl (65 kB)
Using cached httpx-0.15.5-py3-none-any.whl (65 kB)
Using cached httpx-0.15.4-py3-none-any.whl (65 kB)
Using cached httpx-0.15.3-py3-none-any.whl (64 kB)
Using cached httpx-0.15.2-py3-none-any.whl (64 kB)
Using cached httpx-0.15.1-py3-none-any.whl (64 kB)
Using cached httpx-0.15.0-py3-none-any.whl (64 kB)
Using cached httpx-0.14.3-py3-none-any.whl (62 kB)
Using cached httpx-0.14.2-py3-none-any.whl (61 kB)
Using cached httpx-0.14.1-py3-none-any.whl (60 kB)
Using cached httpx-0.14.0-py3-none-any.whl (59 kB)
WARNING: httpx 0.13.3 does not provide the extra 'http2'
Building wheels for collected packages: PyAudio
Building wheel for PyAudio (pyproject.toml) ... error
error: subprocess-exited-with-error

× Building wheel for PyAudio (pyproject.toml) did not run successfully.
│ exit code: 1
╰─> [17 lines of output]
running bdist_wheel
running build
running build_py
creating build
creating build\lib.win-amd64-cpython-310
copying src\pyaudio.py -> build\lib.win-amd64-cpython-310
running build_ext
building '_portaudio' extension
creating build\temp.win-amd64-cpython-310
creating build\temp.win-amd64-cpython-310\Release
creating build\temp.win-amd64-cpython-310\Release\src
"C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.34.31933\bin\HostX86\x64\cl.exe" /c /nologo /O2 /W3 /GL /DNDEBUG /MD -DMS_WIN64=1 -IC:\Users\pc\AppData\Local\Programs\Python\Python310\include -IC:\Users\pc\AppData\Local\Programs\Python\Python310\Include "-IC:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.34.31933\include" "-IC:\Program Files\Microsoft Visual Studio\2022\Community\VC\Auxiliary\VS\include" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.22000.0\ucrt" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.22000.0\um" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.22000.0\shared" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.22000.0\winrt" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.22000.0\cppwinrt" /Tcsrc/_portaudiomodule.c /Fobuild\temp.win-amd64-cpython-310\Release\src/_portaudiomodule.obj
_portaudiomodule.c
C:\Users\pc\AppData\Local\Programs\Python\Python310\include\pyconfig.h(117): warning C4005: 'MS_WIN64': macro redefinition
C:\Users\pc\AppData\Local\Programs\Python\Python310\include\pyconfig.h(117): note: 'MS_WIN64' previously declared on the command line
src/_portaudiomodule.c(29): fatal error C1083: Cannot open include file: 'portaudio.h': No such file or directory
error: command 'C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.34.31933\bin\HostX86\x64\cl.exe' failed with exit code 2
[end of output]

note: This error originates from a subprocess, and is likely not a problem with pip.
ERROR: Failed building wheel for PyAudio
Failed to build PyAudio
ERROR: Could not build wheels for PyAudio, which is required to install pyproject.toml-based projects

hmmm what is and how to fix it ?

PS C:\Users\60107\Downloads\AI-Waifu-Vtuber-master (1)> & "C:/Program Files/Python311/python.exe" "c:/Users/60107/Downloads/AI-Waifu-Vtuber-master (1)/AI-Waifu-Vtuber-master/run.py"
Mode (1-Mic, 2-Youtube Live, 3-Twitch Live): 1
Press and Hold Right Shift to record audio
Recording...
Stopped recording.
Error transcribing audio
Recording...
Stopped recording.
Error transcribing audio
Recording...
Stopped recording.
Error transcribing audio
Recording...
Stopped recording.
Error transcribing audio
Recording...
Stopped recording.
Error transcribing audio

Error transcribing audio

Traceback (most recent call last):
File "C:\Users\Administrator\AI-Waifu-Vtuber\run.py", line 141, in
record_audio()
File "C:\Users\Administrator\AI-Waifu-Vtuber\run.py", line 54, in record_audio
transcribe_audio("input.wav")
File "C:\Users\Administrator\AI-Waifu-Vtuber\run.py", line 63, in transcribe_audio
chat_raw = transcript.text
^^^^^^^^^^
UnboundLocalError: cannot access local variable 'transcript' where it is not associated with a value

ada solusi ga bg?

[Feature Request]: Get answers by writing, and totally free (no Openai API)

Can this webui be integrated into your code? To not use OpenAi Api which is not free... (I know, I'm stingy). Anyway, the webui does not require a powerful computer, and supports several models. And based on this video from minute 17:45 we see that the webui can also generate audio files (using the TTS extension).
1. So, can be added a 3° method, to write and pass the generated message to "speech_text" (if this is the right function) ?
2. Can the generated audio file be used to make the vtuber model's mouth move? I don't know if it's possible to pass the audio with/to the VB-Audio Virtual Cable, or if it's the right method. Maybe this way we don't need the voice synthesizer/text to speech

Edit:

  1. I think that webui is too much complicated to use to write and get answers, to send then to ardha27's app, but maybe this console is the right way. More details in the comments.
  2. I managed to connect the virtual audio cable to the speakers and make the vtuber model talk when the webui produces responses (totally free, without using Openai Api), but I still think it would be nice to be able to switch between 3 modes with ardha27's app: use the mic or livechat when you stream, or just text if you don't stream and you don't want to make too much noise..

The response is doubled

KECAPasin berkata: katakan sesuatu
ID Answer: 何 が 言い たい の? 私 を 見る ため に 来 て 、 ただ 何 か 言い 言い たい だけ そうだ と し し たら 私 にとって は 無駄 な 時間 取っ いる いる 忙しいわよ 忙しいわよ 忙しいわよ 忙しいわよ 、 取っ
いる て て 取っ て 取っ 取っ 取っ 取っ 取っ 取っ 取っじゃない わ。 もっと 興味 深い ことがある 人 たち と 話 し たい の。
JP Answer: 何が言いが言い?のの?私をををためために来、ただただ何かか言い言いだけだけ?そうだそうだととしじゃないわ。もっともっと興味深いことがある人としたい

dont know why this happen

NameError: name 'tts_en' is not defined

Hello, i try to follow your step by step, but i got error like this.

Mode (1-Mic, 2-Youtube Live, 3-Twitch Live): 1
Press and Hold Right Shift to record audio
Recording...
Stopped recording.
Question:
JP Answer: アルダは何と言ったのですか?
Traceback (most recent call last):
File "C:\Users\GRIGORZERO\Documents\AI VTUBER\AI-Waifu-Vtuber-master\run.py", line 246, in
record_audio()
File "C:\Users\GRIGORZERO\Documents\AI VTUBER\AI-Waifu-Vtuber-master\run.py", line 68, in record_audio
transcribe_audio("input.wav")
File "C:\Users\GRIGORZERO\Documents\AI VTUBER\AI-Waifu-Vtuber-master\run.py", line 87, in transcribe_audio
openai_answer()
File "C:\Users\GRIGORZERO\Documents\AI VTUBER\AI-Waifu-Vtuber-master\run.py", line 123, in openai_answer
translate_text(message)
File "C:\Users\GRIGORZERO\Documents\AI VTUBER\AI-Waifu-Vtuber-master\run.py", line 204, in translate_text
silero_tts(tts_en, "en", "v3_en", "en_21")
NameError: name 'tts_en' is not defined

I want to use silero and already try to install "pip install silero"
Should i added import silero at your 'run.py'?

Oh yeah i already change it to Silero too

# Choose between the available TTS engines
# Japanese TTS
#voicevox_tts(tts)

# Silero TTS, Silero TTS can generate English, Russian, French, Hindi, Spanish, German, etc. Uncomment the line below. Make sure the input is in that language
silero_tts(tts_en, "en", "v3_en", "en_21") 

Pls halp

Import Error: DLL Load Failed & Error Transcribing Audio

When I start the run.py program and select 1 - Mic, and record the audio file, it keeps returning an Error Transcribing Audio error back and I can't seem to figure out what the issue is. I doubled check if the OpenAI auth key is correct and the input.wav file does have the audio inside, is there any way to fix it?

Problems during code run

I have used English translation software, so please excuse any inaccuracies. I followed the instructions and entered the openai key, downloaded the VOICEVOX file and ran it on Docker, also updated and installed the openai and other modules, then ran python run.py in the terminal and it came up with Recording..., Stopped recording, Question: Hello, Error transcribing audio. I'm getting Recording..., Stopped recording, Question: Hello, Error transcribing audio. I did record the voice, but only the question was displayed, not the answer, and the result was Error transcribing audio.

AI doesnt answer at Twitch Live

Hello, sorry for bothering you again.

I have question about twitch.

This is the code that i entered
server = 'irc.chat.twitch.tv'
port = 6667
nickname = 'testing'
token = 'oauth:qdgf4hsewydt5nw---- bla bla bla' # https://twitchapps.com/tmi/
user = 'grigorzero' # Your Twitch username
channel = 'GrigorZero' # The channel you want to retrieve messages from

I got "Error receiving chat" for trying to use the twitch live chat.
Do i have to change the channel into link when i live or i have to add #GrigorZero at channel?

I live right know to test the AI https://www.twitch.tv/grigorzero

AssertionError: `speaker` should be in fr_0, fr_1, fr_2, fr_3, fr_4, fr_5, random

Traceback (most recent call last):
  File "C:\Users\lecri\Desktop\AI-Waifu-Vtuber-master\run.py", line 261, in <module>
    record_audio()
  File "C:\Users\lecri\Desktop\AI-Waifu-Vtuber-master\run.py", line 70, in record_audio
    transcribe_audio("input.wav")
  File "C:\Users\lecri\Desktop\AI-Waifu-Vtuber-master\run.py", line 91, in transcribe_audio
    openai_answer()
  File "C:\Users\lecri\Desktop\AI-Waifu-Vtuber-master\run.py", line 126, in openai_answer
    translate_text(message)
  File "C:\Users\lecri\Desktop\AI-Waifu-Vtuber-master\run.py", line 217, in translate_text
    silero_tts(tts_en, "en", "v3_en", "en_en")
  File "C:\Users\lecri\Desktop\AI-Waifu-Vtuber-master\utils\TTS.py", line 23, in silero_tts
    audio_paths = model.save_wav(text=tts,
                  ^^^^^^^^^^^^^^^^^^^^^^^^
  File "<torch_package_0>.multi_acc_v3_package.py", line 366, in save_wav
  File "<torch_package_0>.multi_acc_v3_package.py", line 303, in apply_tts
AssertionError: `speaker` should be in fr_0, fr_1, fr_2, fr_3, fr_4, fr_5, random

Max open files error

When it runs for some hours it reaches the max file opens and throw an error.

Error printing text: open file failed because of errno 24 on fopen: Too many open files.

DeepL

hey there is there any way to use google trans api instead of deepL as its not available in many countries!

How to

When streaming on youtube. How do you keep the ai running and not breaking occasionally because my ai stops answering sometimes or gets an error saying "this model is overloaded try resetting or contacting support"

Getting requirements to build wheel did not run successfully.

Hey Guys, I am on Macbook Intel Process and I am getting this error after the "pip install -r requirements.txt" command.

Getting requirements to build wheel ... error
error: subprocess-exited-with-error

× Getting requirements to build wheel did not run successfully.
│ exit code: 1
╰─> [24 lines of output]
/bin/sh: mecab-config: command not found
Traceback (most recent call last):
File "/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py", line 353, in
main()
File "/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py", line 335, in main
json_out['return_val'] = hook(**hook_input['kwargs'])
^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py", line 118, in get_requires_for_build_wheel
return hook(config_settings)
^^^^^^^^^^^^^^^^^^^^^
File "/private/var/folders/dm/6qxjk8yn7psfkx1956c6h6yr0000gn/T/pip-build-env-_3hvhuxz/overlay/lib/python3.11/site-packages/setuptools/build_meta.py", line 341, in get_requires_for_build_wheel
return self._get_build_requires(config_settings, requirements=['wheel'])
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/private/var/folders/dm/6qxjk8yn7psfkx1956c6h6yr0000gn/T/pip-build-env-_3hvhuxz/overlay/lib/python3.11/site-packages/setuptools/build_meta.py", line 323, in _get_build_requires
self.run_setup()
File "/private/var/folders/dm/6qxjk8yn7psfkx1956c6h6yr0000gn/T/pip-build-env-_3hvhuxz/overlay/lib/python3.11/site-packages/setuptools/build_meta.py", line 488, in run_setup
self).run_setup(setup_script=setup_script)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/private/var/folders/dm/6qxjk8yn7psfkx1956c6h6yr0000gn/T/pip-build-env-_3hvhuxz/overlay/lib/python3.11/site-packages/setuptools/build_meta.py", line 338, in run_setup
exec(code, locals())
File "", line 53, in
File "", line 19, in cmd2
File "", line 15, in cmd1
IndexError: list index out of range
[end of output]

note: This error originates from a subprocess, and is likely not a problem with pip.
error: subprocess-exited-with-error

× Getting requirements to build wheel did not run successfully.
│ exit code: 1
╰─> See above for output.

note: This error originates from a subprocess, and is likely not a problem with pip.

Failed to Transcribe Audio, no other errors

I keep getting an immediate failed to transcribe error. I don't get any other information other than the terminal just saying that.
I'm running VoiceVox on Collab, my Open AI API key says it hasn't been used yet, running all this in PowerShell.

Retracing my steps in a clean install- I Had some errors when installing the requirement.txt when it came to pyaudio.
log.txt
^Here's a log I made of the terminal since there's no error log present

Doesn't reconnect after connection error

Exception in thread Thread-1 (preparation):
Traceback (most recent call last):
File "C:\Users\pikat\miniconda3\lib\site-packages\urllib3\connectionpool.py", line 703, in urlopen
httplib_response = self._make_request(
File "C:\Users\pikat\miniconda3\lib\site-packages\urllib3\connectionpool.py", line 449, in _make_request
six.raise_from(e, None)
File "", line 3, in raise_from
File "C:\Users\pikat\miniconda3\lib\site-packages\urllib3\connectionpool.py", line 444, in _make_request
httplib_response = conn.getresponse()
File "C:\Users\pikat\miniconda3\lib\http\client.py", line 1374, in getresponse
response.begin()
File "C:\Users\pikat\miniconda3\lib\http\client.py", line 318, in begin
version, status, reason = self._read_status()
File "C:\Users\pikat\miniconda3\lib\http\client.py", line 287, in _read_status
raise RemoteDisconnected("Remote end closed connection without"
http.client.RemoteDisconnected: Remote end closed connection without response

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "C:\Users\pikat\AppData\Roaming\Python\Python310\site-packages\requests\adapters.py", line 489, in send
resp = conn.urlopen(
File "C:\Users\pikat\miniconda3\lib\site-packages\urllib3\connectionpool.py", line 787, in urlopen
retries = retries.increment(
File "C:\Users\pikat\miniconda3\lib\site-packages\urllib3\util\retry.py", line 550, in increment
raise six.reraise(type(error), error, _stacktrace)
File "C:\Users\pikat\miniconda3\lib\site-packages\urllib3\packages\six.py", line 769, in reraise
raise value.with_traceback(tb)
File "C:\Users\pikat\miniconda3\lib\site-packages\urllib3\connectionpool.py", line 703, in urlopen
httplib_response = self._make_request(
File "C:\Users\pikat\miniconda3\lib\site-packages\urllib3\connectionpool.py", line 449, in _make_request
six.raise_from(e, None)
File "", line 3, in raise_from
File "C:\Users\pikat\miniconda3\lib\site-packages\urllib3\connectionpool.py", line 444, in _make_request
httplib_response = conn.getresponse()
File "C:\Users\pikat\miniconda3\lib\http\client.py", line 1374, in getresponse
response.begin()
File "C:\Users\pikat\miniconda3\lib\http\client.py", line 318, in begin
version, status, reason = self._read_status()
File "C:\Users\pikat\miniconda3\lib\http\client.py", line 287, in _read_status
raise RemoteDisconnected("Remote end closed connection without"
urllib3.exceptions.ProtocolError: ('Connection aborted.', RemoteDisconnected('Remote end closed connection without response'))

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "C:\Users\pikat\miniconda3\lib\site-packages\openai\api_requestor.py", line 516, in request_raw
result = _thread_context.session.request(
File "C:\Users\pikat\AppData\Roaming\Python\Python310\site-packages\requests\sessions.py", line 587, in request
resp = self.send(prep, **send_kwargs)
File "C:\Users\pikat\AppData\Roaming\Python\Python310\site-packages\requests\sessions.py", line 701, in send
r = adapter.send(request, **kwargs)
File "C:\Users\pikat\AppData\Roaming\Python\Python310\site-packages\requests\adapters.py", line 547, in send
raise ConnectionError(err, request=request)
requests.exceptions.ConnectionError: ('Connection aborted.', RemoteDisconnected('Remote end closed connection without response'))

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
File "C:\Users\pikat\miniconda3\lib\threading.py", line 1016, in _bootstrap_inner
self.run()
File "C:\Users\pikat\miniconda3\lib\threading.py", line 953, in run
self._target(*self._args, **self._kwargs)
File "C:\Users\pikat\Downloads\AI-Waifu-Vtuber-master\run.py", line 242, in preparation
openai_answer()
File "C:\Users\pikat\Downloads\AI-Waifu-Vtuber-master\run.py", line 111, in openai_answer
response = openai.ChatCompletion.create(
File "C:\Users\pikat\miniconda3\lib\site-packages\openai\api_resources\chat_completion.py", line 25, in create
return super().create(*args, **kwargs)
File "C:\Users\pikat\miniconda3\lib\site-packages\openai\api_resources\abstract\engine_api_resource.py", line 153, in create
response, _, api_key = requestor.request(
File "C:\Users\pikat\miniconda3\lib\site-packages\openai\api_requestor.py", line 216, in request
result = self.request_raw(
File "C:\Users\pikat\miniconda3\lib\site-packages\openai\api_requestor.py", line 528, in request_raw
raise error.APIConnectionError(
openai.error.APIConnectionError: Error communicating with OpenAI: ('Connection aborted.', RemoteDisconnected('Remote end closed connection without response'))
Error receiving chat: 'NoneType' object has no attribute 'group'
Error receiving chat: 'NoneType' object has no attribute 'group'
fenrircrow said BocchiPossessed
fenrircrow said BocchiPossessed 󠀀
fenrircrow said BocchiPossessed
fenrircrow said BocchiPossessed 󠀀
fenrircrow said BocchiPossessed
Error receiving chat: 'NoneType' object has no attribute 'group'

I got some questions!

can the ai speak in english?
also can i use this with google translate instead of deepL?
like a good addition would be using google translate if someone doesn't want to use DeepL
and lastly can we use this with twitch?
and if you can add a demo, because the current demo doesn't work. at least a short video showcasing the ai!
after good work and hope for the best for you!

No modules named errors

Hello!

First off I love this project and I am dying to use it, sadly I ran into some issues before this, but I can't pass this one. Can you give me a hand?

Thanks in advance

imagen_2023-05-11_133610322

imagen_2023-05-11_133436631

subtitles!

how to remove indonesian subtitles and use english subtitles ?

VB cablenya g kerja

Programnya kerja, tapi suaranya g masuk ke vtube studio, sehingga mulutnya g gerak.

Can't connect to channels when their name have an underscore

I can't connect to my twitch account to read my chat, I can connect to other users who don't have underscores.
I'm sure it's because of the underscores in the account name.
For example accounts with nicknames - "ai_sample, s_a_m_p_l_e, t_e_s_t" will not connect to chat.
And such nicknames as "aisample, sample, test" will connect without any problems.

Error with Mecab

is there any idea what is causing the following error when i attempt to run run.py? i've installed mecab with the command pip install mecab as well.

ImportError: DLL load failed while importing _MeCab: The specified module could not be found.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.