Skip to content

Commit

Permalink
Fix python pyttsx3/drivers/_espeak.py
Browse files Browse the repository at this point in the history
```diff
-    print(Synth(s))
+    print(Synth(s.encode("utf-8")))
```
Before:
% `python pyttsx3/drivers/_espeak.py`
```
ctypes.ArgumentError: argument 1: TypeError: 'str' object cannot be interpreted as ctypes.c_char_p
```
After: eSpeak-NG pronounces the message.
  • Loading branch information
cclauss authored Nov 6, 2024
1 parent 800b451 commit 6293fc0
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions pyttsx3/drivers/_espeak.py
Original file line number Diff line number Diff line change
Expand Up @@ -542,8 +542,8 @@ def synth_cb(wav, numsample, events):
SetSynthCallback(synth_cb)
s = "This is a test, only a test. "
uid = c_uint(0)
# print 'pitch=',GetParameter(PITCH)
# print('pitch=',GetParameter(PITCH))
# SetParameter(PITCH, 50, 0)
print(Synth(s))
print(Synth(s.encode("utf-8")))
while IsPlaying():
time.sleep(0.1)

0 comments on commit 6293fc0

Please sign in to comment.