def play():
global text_2
global language
#print(text_2)
my_audio = gTTS(text=text_2, lang=language)
my_audio.save("hello.mp3")
here text_2 is a page from pdf
when I run this I get an error but when I run this with short text it works perfectly fine .
Exception in thread Thread-1:
Traceback (most recent call last):
File "C:\python3.9\lib\threading.py", line 950, in _bootstrap_inner
self.run()
File "C:\python3.9\lib\threading.py", line 888, in run
self._target(*self._args, **self._kwargs)
File "C:\Users\NK Infosystem\PycharmProjects\audiobook\main.py", line 79, in play
my_audio.save("hello.mp3")
File "C:\python3.9\lib\site-packages\gtts\tts.py", line 311, in save
self.write_to_fp(f)
File "C:\python3.9\lib\site-packages\gtts\tts.py", line 293, in write_to_fp
raise gTTSError(tts=self, response=r)
gtts.tts.gTTSError: 200 (OK) from TTS API. Probable cause: Unknown