Post
정말 오프라인 tts가 별로 없다.
전부 어디 웹에 들어가서 서버에 정보가 저장되는지 또다른 ai 재료로 써먹히는지 모른채
불안불안하게 TTS를 사용해야한다.
그러다가 프로그램 대용으로 파이썬 패키지 pyttsx3 을 설치하고 사용하는 법도 있다는 걸 알게되었다.
일단 window cmd창을 켜서 pyttsx3를 설치해준다.
pip install pyttsx3
그 후 아래 파이썬 코드를 실행시킨다.
https://www.geeksforgeeks.org/python/python-text-to-speech-by-using-pyttsx3/
Text to Speech by using pyttsx3 - Python - GeeksforGeeks
Your All-in-One Learning Portal: GeeksforGeeks is a comprehensive educational platform that empowers learners across domains-spanning computer science and programming, school education, upskilling, commerce, software tools, competitive exams, and more.
www.geeksforgeeks.org
위에 프로퍼티 값을 어떻게 정의해야하는지 나온다. 그런데 속도... 난 200보다 더 높으면 좋겠데 200이 최대max이다.
너무 느려...
import pyttsx3
ttstest = pyttsx3.init()
text = """테스트할 tts 샘플 텍스트입니다."""
ttstest.say(text)
#속도
ttstest.setProperty('rate', 200)
#실행
ttstest.runAndWait()
한글이 잘 나온다. 만족까진 아니지만 그럭저럭 사용하기 충분한 것 같다.
"""를 쓴 이유는 따옴표 안에 글자도 글자로 취급하기 위해서.
'이전게시판 > Python' 카테고리의 다른 글
| 무료 파이썬 패키지 edge_tts 예제 (0) | 2025.12.29 |
|---|---|
| 파이썬 이름순으로 정렬 후에 이름 바꾸기 (0) | 2025.05.22 |
| 파이썬 한글 글자수 체크 및 특정 단어 갯수 찾기 (0) | 2025.03.30 |
| python 폴더 내 파일 이름 변경 rename (0) | 2025.03.30 |
| inconsistent use of tabs and spaces in indentation in Python (0) | 2024.04.18 |
| ModuleNotFoundError: No module named 'pandas' 아나콘다가 깔려 있을 때 해결법 (0) | 2024.01.27 |
| Python 크롤링 리스트 출력 (1) | 2023.04.10 |