diff --git a/src/edgeTTS/__init__.py b/src/edgeTTS/__init__.py index a6ed241..31c66d7 100755 --- a/src/edgeTTS/__init__.py +++ b/src/edgeTTS/__init__.py @@ -122,7 +122,7 @@ class Communicate: if not customspeak: wsmax = 2 ** 16 - overhead = len(self.mkssmlmsg("", voice, pitch, rate, volume, customspeak=False)) + overhead = len(self.mkssmlmsg("", voice, pitch, rate, volume, customspeak=False).encode('utf-8')) msgs = _minimize(escape(removeIncompatibleControlChars(msg)), b" ", wsmax - overhead) async with websockets.connect(