speake3
1.0.0
SPEAKE3 라이브러리는 Espeak 주변의 래퍼를 제공하여 Python에서 Espeak TTS 엔진의 텍스트 음성 연설 기능을 사용하여 효율적인 프로그램을 쉽게 작성합니다.
- Linux system
- Espeak
- python3.x
PIP가 단순히 설치된 경우;
pip3 install speake3
Speake 모듈을 사용한 간단한 스크립트;
>>> import speake3
>>>
>>> engine = speake3.Speake() # Initialize the speake engine
>>> engine.set('voice', 'en')
>>> engine.set('speed', '107')
>>> engine.set('pitch', '99')
>>> engine.say("Hello world!") #String to be spoken
>>> engine.talkback()
ESPEAK의 버전을 설치할 수 있습니다.
>>> version = engine.get("version")
>>> print(version)
일반적으로 및 구체적으로 시스템에 설치된 음성을 볼 수 있습니다.
>>> voices = engine.get("voices") # General
>>> for voice in voices:
>>> print(voice)
>>> voices_2 = engine.get("voices", "en") # Specific
>>> for voice in voices_2:
>>> print(voice)
설정 방법을 사용하여 속성을 설정할 수 있습니다.
>>> engine.set("voice", "en") # voice attribute can be any VoiceName value or
>>> #File value gotten from the voices dictionaries
설정할 수있는 가능한 속성은 textfile, stdin, amplitude, wordgap, capitals, line-length, pitch, speed, voice, wavfile, stdout, version, voices, text-encoding, markup, quiet, punct, split, write-pm, nopause
설정된 속성도 세트 할 수 있습니다.
>>> engine.unset("speed")
>>> engine.unset("pitch")
토크백 메소드를 호출하기 전에 여러 번의 통화를하는 경우, 내부 대기열에 넣기 때문에 다른 문자열 매개 변수는 다른 문자열 매개 변수를 말하면됩니다.
>>> engine.say("Hello World")
>>> engine.say("Foo bar")
>>> engine.say("Monty Python")
>>> engine.talkback()