Skip to content

ModuleNotFoundError: No module named 'TTS' #23

Description

@elcolie

Code raises error when trying to follow the official snippets.

/Users/sarit/.pyenv/versions/learn_typhoon_ocr/bin/python /Users/sarit/fullstack/learn_typhoon_ocr/test_pythaitts.py 
Traceback (most recent call last):
  File "/Users/sarit/fullstack/learn_typhoon_ocr/test_pythaitts.py", line 34, in <module>
    tts = TTS(pretrained="khanomtan")
          ^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/sarit/.pyenv/versions/learn_typhoon_ocr/lib/python3.12/site-packages/pythaitts/__init__.py", line 40, in __init__
    self.load_pretrained(version=version)
  File "/Users/sarit/.pyenv/versions/learn_typhoon_ocr/lib/python3.12/site-packages/pythaitts/__init__.py", line 50, in load_pretrained
    from pythaitts.pretrained.khanomtan_tts import KhanomTan
  File "/Users/sarit/.pyenv/versions/learn_typhoon_ocr/lib/python3.12/site-packages/pythaitts/pretrained/khanomtan_tts.py", line 12, in <module>
    from TTS.utils.synthesizer import Synthesizer
ModuleNotFoundError: No module named 'TTS'

Process finished with exit code 1
import sounddevice as sd
import soundfile as sf
from pythaitts import TTS

tts = TTS()

tts = TTS(pretrained="khanomtan")
file = tts.tts("ภาษาไทย", speaker_idx="Linda", filename="kanontan.wav")
data, samplerate = sf.read(file)
print(f"เล่นจากไฟล์: {file}")
sd.play(data, samplerate)
sd.wait()  # รอจนเล่นเสร็จ

pythaitts==0.4.2

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions