mh0w/Text-to-Speech-TTS-3000

Crashes if too much text highlighted (out of memory)

Opened this issue · 0 comments

mh0w commented

The audio file is generated without issue. It might just be the duration = pygame.mixer.Sound(outfile_wav).get_length() line that causes the crash, or it might be the case that loading in the file in any way will cause a crash.

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
~~ TTS 3000 is now running ~~
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

CTRL + b == play/pause highlighted text (not in this terminal/console window)
CTRL + i == stop
ALT  + v == back 10s

Minimise this prompt/console/terminal window to use TTS 3000

Close this prompt/console/terminal window to quit TTS 3000
Exception in thread Thread-2:
Traceback (most recent call last):
  File "C:\Users\hawkem\Anaconda3\lib\threading.py", line 932, in _bootstrap_inner
    self.run()
  File "C:\Users\hawkem\Anaconda3\lib\threading.py", line 870, in run
    self._target(*self._args, **self._kwargs)
  File "C:\Users\hawkem\AppData\Roaming\Python\Python38\site-packages\keyboard\_generic.py", line 58, in process
    if self.pre_process_event(event):
  File "C:\Users\hawkem\AppData\Roaming\Python\Python38\site-packages\keyboard\__init__.py", line 218, in pre_process_event
    callback(event)
  File "C:\Users\hawkem\AppData\Roaming\Python\Python38\site-packages\keyboard\__init__.py", line 649, in <lambda>
    handler = lambda e: (event_type == KEY_DOWN and e.event_type == KEY_UP and e.scan_code in _logically_pressed_keys) or (event_type == e.event_type and callback())
  File "main.py", line 128, in speak_highlighted
    duration = pygame.mixer.Sound(outfile_wav).get_length()
pygame.error: Out of memory