SociallyIneptWeeb / LanguageLeapAI

Your Personal Multilingual AI Translator
MIT License
849 stars 168 forks source link

struct.error: argument out of range for voice_translator.py #57

Open ghost opened 1 year ago

ghost commented 1 year ago

I can hold down the key just fine, but when I let go I get this massive error. I am running the program using docker, and I have already double checked that the local service URLS are correct.

Exception in thread Thread-2 (process):
Traceback (most recent call last):
  File "C:\Users\kylez\AppData\Local\Programs\Python\Python310\lib\threading.py", line 1016, in _bootstrap_inner
    self.run()
  File "C:\Users\kylez\AppData\Local\Programs\Python\Python310\lib\threading.py", line 953, in run
    self._target(*self._args, **self._kwargs)
  File "C:\Users\kylez\AppData\Local\Programs\Python\Python310\lib\site-packages\keyboard\_generic.py", line 58, in process
    if self.pre_process_event(event):
  File "C:\Users\kylez\AppData\Local\Programs\Python\Python310\lib\site-packages\keyboard\__init__.py", line 213, in pre_process_event
    key_hook(event)
  File "C:\Users\kylez\AppData\Local\Programs\Python\Python310\lib\site-packages\keyboard\__init__.py", line 516, in <lambda>
    return hook_key(key, lambda e: e.event_type == KEY_DOWN or callback(e), suppress=suppress)
  File "G:\LanguageLeapAI\src\voice_translator.py", line 58, in on_release_key
    wf.writeframes(b''.join(frames))
  File "C:\Users\kylez\AppData\Local\Programs\Python\Python310\lib\wave.py", line 437, in writeframes
    self.writeframesraw(data)
  File "C:\Users\kylez\AppData\Local\Programs\Python\Python310\lib\wave.py", line 426, in writeframesraw
    self._ensure_header_written(len(data))
  File "C:\Users\kylez\AppData\Local\Programs\Python\Python310\lib\wave.py", line 467, in _ensure_header_written
    self._write_header(datasize)
  File "C:\Users\kylez\AppData\Local\Programs\Python\Python310\lib\wave.py", line 479, in _write_header
    self._file.write(struct.pack('<L4s4sLHHLLHH4s',
struct.error: argument out of range
Exception ignored in: <function Wave_write.__del__ at 0x0000017E045BF7F0>
Traceback (most recent call last):
  File "C:\Users\kylez\AppData\Local\Programs\Python\Python310\lib\wave.py", line 326, in __del__
    self.close()
  File "C:\Users\kylez\AppData\Local\Programs\Python\Python310\lib\wave.py", line 444, in close
    self._ensure_header_written(0)
  File "C:\Users\kylez\AppData\Local\Programs\Python\Python310\lib\wave.py", line 467, in _ensure_header_written
    self._write_header(datasize)
  File "C:\Users\kylez\AppData\Local\Programs\Python\Python310\lib\wave.py", line 479, in _write_header
    self._file.write(struct.pack('<L4s4sLHHLLHH4s',
struct.error: argument out of range