frodekp / DECtalk-Twitch-TTS-bot

DECtalk Twitch text-to-speech bot is a bot that reads out chat messages with DECtalk. DECtalk is famously used by Professor Stephen Hawking, The US National Weather Service, Back To The Future Part II, Benny Benassi, and last but not least the game Moonbase Alpha.
GNU General Public License v3.0
10 stars 3 forks source link

FileNotFoundError #9

Closed MignightApe closed 1 year ago

MignightApe commented 1 year ago

When sending a message in Twitch chat, the Traceback states the following:

Input: Traceback (most recent call last): File "C:\Users{omitted}\DECtalkTTS\dectalktwitchtts.py", line 68, in say_single_message wave_obj = sa.WaveObject.from_wave_file(temp_wav) File "C:\Users{omitted}\AppData\Local\Programs\Python\Python39\lib\site-packages\simpleaudio\shiny.py", line 24, in from_wave_file wave_read = wave.open(wave_file, 'rb') File "C:\Users{omitted}\AppData\Local\Programs\Python\Python39\lib\wave.py", line 509, in open return Wave_read(f) File "C:\Users{omitted}\AppData\Local\Programs\Python\Python39\lib\wave.py", line 159, in init f = builtins.open(f, 'rb') FileNotFoundError: [Errno 2] No such file or directory: 'C:\Users\{omitted}\DECtalkTTS\tmp\79058a79-9d4d-11ed-8588-7cb27d5deecd.wav'

I am brand new to programming so I cannot determine the issue. It seems Speak.exe or Say.exe are suppose to make and play a wav file. I have tried chat messages with both applications open and closed.

I should mention that there is no audio playing.

Thanks!

frodekp commented 1 year ago

You are correct about that Say.exe is supposed to make a .wav file, and a library called "simpleaudio" is supposed to play it. But it seems like it fails to generate the file.

What python version are you using, and did you change anything in config.py below the MODE setting?

awalkerg commented 1 year ago

Hi, I'm having a similar issue.

Input: sh: wine: command not found Traceback (most recent call last): File "/Users/.../Desktop/DECtalk-Twitch-TTS-bot/dectalktwitchtts.py", line 68, in say_single_message wave_obj = sa.WaveObject.from_wave_file(temp_wav) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.11/site-packages/simpleaudio/shiny.py", line 24, in from_wave_file wave_read = wave.open(wave_file, 'rb') ^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/Cellar/python@3.11/3.11.1/Frameworks/Python.framework/Versions/3.11/lib/python3.11/wave.py", line 630, in open return Wave_read(f) ^^^^^^^^^^^^ File "/usr/local/Cellar/python@3.11/3.11.1/Frameworks/Python.framework/Versions/3.11/lib/python3.11/wave.py", line 280, in init f = builtins.open(f, 'rb') ^^^^^^^^^^^^^^^^^^^^^^ FileNotFoundError: [Errno 2] No such file or directory: '/Users/.../Desktop/DECtalk-Twitch-TTS-bot/tmp/f7ffcb6a-9e71-11ed-aaf5-8c85906b9cbe.wav'

I'm using python 3.11.1

I edited MODE to 'queue' and SAY_USERNAME to True

frodekp commented 1 year ago

@awalkerg It looks like you are using linux. I'ts required to have wine installed to run Say.exe.

awalkerg commented 1 year ago

My bad, I only had wineskin installed!

MignightApe commented 1 year ago

What python version are you using, and did you change anything in config.py below the MODE setting?

Running 'python' in command says I have Python 3.9.4. Did a "fresh install" of the program to be sure I didn't edit config.py below MODE and I receive the same error. Does the folder need to be in a particular drive? After running the bot with python dectalktwitchtts.py, should I also have say.exe or speak.exe open as well? Lastly, is it better to run test chat messages in OBS or Twitch directly?

Thanks again.

frodekp commented 1 year ago

@MignightApe You don't need to run anything else than python dectalktwitchtts.py, so don't worry about say.exe and speak.exe as long as they are in the same folder.

The only changes that are required to make it work is the lines nickname, token and channel inside config.py.

Edit: You also have to python -m pip install -r requirements.txt at least once before you run python dectalktwitchtts.py. Make sure that doesn't give any errors.

MignightApe commented 1 year ago

@frodekp Python was updated to 3.11.1. I'd forgotten to run python -m pip install -r requirements.txt prior to python dectalktwitchtts.py. I closed command, ran python -m pip install -r requirements.txt then python dectalktwitchtts.py. Now receiving the following. (When reinstalling I chose a separate drive than C:)

Input: Traceback (most recent call last): File "W:{omitted}\Streamerbot Etc\DECtalk\DECtalk-Twitch-TTS-bot-master\dectalktwitchtts.py", line 68, in say_single_message wave_obj = sa.WaveObject.from_wave_file(temp_wav) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Users{omitted}\AppData\Local\Programs\Python\Python311\Lib\site-packages\simpleaudio\shiny.py", line 24, in from_wave_file wave_read = wave.open(wave_file, 'rb') ^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Users{omitted}\AppData\Local\Programs\Python\Python311\Lib\wave.py", line 630, in open return Wave_read(f) ^^^^^^^^^^^^ File "C:\Users{omitted}\AppData\Local\Programs\Python\Python311\Lib\wave.py", line 280, in init f = builtins.open(f, 'rb') ^^^^^^^^^^^^^^^^^^^^^^ FileNotFoundError: [Errno 2] No such file or directory: 'W:\{omitted}\Streamerbot Etc\DECtalk\DECtalk-Twitch-TTS-bot-master\tmp\98d0f1c4-9f40-11ed-89b0-7cb27d5deecd.wav'

frodekp commented 1 year ago

@MignightApe I was able to recreate the issue when i runned it in a similar path .\Streamerbot Etc\DECtalk\DECtalk-Twitch-TTS-bot\. I got the same error message. But when I renamed the Streamerbot Etc folder to StreamerbotEtc it worked. So the issue seems to be that say.exe won't run if the path contains space.

MignightApe commented 1 year ago

@frodekp Moved the entire folder to W:\DECTalk and it works now! Since the other Streamerbot Etc folder was referenced in a number of other applications, taking the space out wouldn't have worked. Placing it in a folder where the address doesn't include any spaces seems to have done the trick. Thanks so much for your help!